Reputation: 878
I have had issues installing the sklearn module in Python Canopy on Windows. I have a separate Python 3.3 and 2.7 (64-bit) installation too. But I have eliminated all the 3.3 env variables, so only 2.7 may be a problem. However any module installed to 2.7 seems to get ignored regardless..
Eventually I thought I solved the issue by copy-pasting the folder into site-packages where Canopy was installed.
This seems to allow me to import sklearn successfully. However it seems that I can't use it when trying this example in IDLE. The error output is included below.
What are the steps I should take to solve this? Does copy-pasting modules generally lead to problems?
UPDATE: ran another script which has these imports (from sklearn.lda import LDA from sklearn.qda import QDA) and it runs... so I really have no idea what's going on still.
Traceback (most recent call last): File "D:/Documents/2013 - 2014/Kaggle/bioresponse/sklearn_test/feature_selection_pipeline.py", line 11, in from sklearn import svm File "C:\Users\N\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.1.0.1371.win-x86_64\lib\site-packages\sklearn\svm__init__.py", line 13, in from .classes import SVC, NuSVC, SVR, NuSVR, OneClassSVM, LinearSVC File "C:\Users\N\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.1.0.1371.win-x86_64\lib\site-packages\sklearn\svm\classes.py", line 1, in from .base import BaseLibLinear, BaseSVC, BaseLibSVM File "C:\Users\N\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.1.0.1371.win-x86_64\lib\site-packages\sklearn\svm\base.py", line 8, in from . import libsvm, liblinear ImportError: DLL load failed: The specified module could not be found.
Upvotes: 0
Views: 958
Reputation: 5810
A well-behaved .exe installer (such as http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn) locates Python from entries in the Windows registry. These registry entries point to the "default Python". You can set (and unset) Canopy as the default Python in the Canopy preferences menu.
Even easier -- the Canopy full installer (available with a Basic subscription or a free academic subscription) includes scikit-learn.
Upvotes: 1