m. vossberg
m. vossberg

Reputation: 11

ImportError: No module named sklearn.cluster in dbscan example

on Ubuntu 16.04 with Anaconda python 2.7, attempting http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html. Getting import error: ImportError: No module named sklearn.cluster. This is from the example code line: from sklearn.cluster import DBSCAN.

I have scikit-learn installed via conda and all appears to be correct.

Any assistance would be greatly appreciated.

thanks

Upvotes: 1

Views: 24965

Answers (2)

Shashi Kiran
Shashi Kiran

Reputation: 63

Try running the program explicitly like this:

$python3 your_program.py

Upvotes: 0

cloudy
cloudy

Reputation: 162

Did you install scikit-learn?

Make shure you already have a working installation of numpy and scipy

  • Python (>= 2.6 or >= 3.3)
  • NumPy (>= 1.6.1)
  • SciPy (>= 0.9).

With pip (don't use it if you installed it with anaconda):

pip install -U scikit-learn

Or with condo:

conda install scikit-learn

Or try to upgrade scikit-learn (if you installed it with anaconda or conda)

conda update scikit-learn

You can find a detailed description here: http://scikit-learn.org/stable/install.html

Upvotes: 6

Related Questions