1
votes

I installed Anaconda on 64bit windows and I also installed scikit-learn using "conda install scikit-learn". However I can't find scikit-learn when I print out all modules installed in python, and I can't import scikit-learn. So I guess the package wasn't installed correctly.

But if I do "conda update scikit-learn", it will print "all reuqested packages already installed. Packages in environment at ...\AppData\Local\Continuum\Anaconda:" Scikit-learn 0.15.2 np19py27_0

Any suggestions on what might have gone wrong?

Thanks!

2
How do you make the import ? - polku
i didn't import. I launched a command window, type "python", then in "help()", call "modules" - user2502206
@user2502206, so if you type import sklearn you get an ImportError? - cel
yes, I get a syntax error. File "<ipython-input-3-0f8874ae07c9>", line 1 pip install scikit-learn ^ SyntaxError: invalid syntax - user2502206
OK I figured it out. I typed "import scikit-learn" instead of "import sklearn". Thanks all! - user2502206

2 Answers

7
votes

As mentioned in the comments, you import the scikit-learn module using:

import sklearn
0
votes

If it still does not work then try to activate environment which is by default root, if you have not created separate environment while installing.

Just run from cmd : activate {env_name}

For your case, it would be : activate root then run simple python file to check scikit-learn is imported or not.

demo.py

import sklearn

See output in image below :

enter image description here