Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

import sklearn not working in PyCharm

I installed numpy, scipy and scikit-learn using pip on mac os. However in PyCharm, all imports work except when i try importing sklearn. I tried doing it in the Python shell and it worked fine. Any ideas as to what is causing this? Also, not sure if it is relevant, but i installed scikit-learn last.

The error I receive is unresolved reference

like image 719
daniel3412 Avatar asked Dec 10 '14 16:12

daniel3412


2 Answers

I managed to figure it out, i had to go to the project interpreter and change the python distribution as it had defaulted the OS installed Python rather than my own installed distribution.

like image 122
daniel3412 Avatar answered Sep 21 '22 23:09

daniel3412


This worked for me:

In my PyCharm Community Edition 5.0.4, Preference -> Project Interpreter -> check whether sklearn package is installed for the current project interpreter, if not, install it.

like image 21
Shunan Zhang Avatar answered Sep 18 '22 23:09

Shunan Zhang