简体   繁体   中英

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

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

尝试像这样显式运行程序:

$python3 your_program.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM