python - Error importing scikit-learn modules -
i'm trying call function cluster module, so:
import sklearn db = sklearn.cluster.dbscan()
and following error:
attributeerror: 'module' object has no attribute 'cluster'
tab-completing in ipython, seem have access base, clone, externals, re, setup_module, sys, , warning modules. nothing else, though others (including cluster) in sklearn directory.
following pbu's advice below , using
from sklearn import cluster
i get:
traceback (most recent call last): file "test.py", line 2, in <module> sklearn import cluster file "c:\python34\lib\site-packages\sklearn\cluster\__init__.py", line 6, in <module> .spectral import spectral_clustering, spectralclustering file "c:\python34\lib\site-packages\sklearn\cluster\spectral.py", line 13, in <module> ..utils import check_random_state, as_float_array file "c:\python34\lib\site-packages\sklearn\utils\__init__.py", line 16, in <module> .class_weight import compute_class_weight, compute_sample_weight file "c:\python34\lib\site-packages\sklearn\utils\class_weight.py", line 7, in <module> ..utils.fixes import in1d file "c:\python34\lib\site-packages\sklearn\utils\fixes.py", line 318, in <module> scipy.sparse.linalg import lsqr sparse_lsqr file "c:\python34\lib\site-packages\scipy\sparse\linalg\__init__.py", line 109, in <module> .isolve import * file "c:\python34\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in <module> .iterative import * file "c:\python34\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <module> . import _iterative importerror: dll load failed: specified module not found.
i'm using python 3.4 on windows, scikit-learn 0.16.1.
you don't use numpy+mkl, numpy.
i had same problem , reinstalling numpy mkl
pip install --upgrade --force-reinstall "numpy-1.10.2+mkl-cp35-none-win32.whl"
fixed it.
Comments
Post a Comment