user4352158
user4352158

Reputation: 729

python scikit error - no module named sklearn

When i follow the website (https://www.kaggle.com/wiki/GettingStartedWithPythonForDataScience) and type python makeSubmission.py I get the following error message :

ImportError: No module named sklearn

I think I have already successfully installed the following: Python 3.4 for windows sciPy,NumPy and matplotlib setuptools scikit-learn PyCharm

I then opened "Python 3.4 command line" and typed import sys; print(sys.__path__),but I got the message

Traceback (most recent call last): File "<stdin>", line 1, in <module>
AttributeError: module object has no attribute '__path__'

Anyone can help?

Upvotes: 13

Views: 62447

Answers (3)

Akhzar Nazir
Akhzar Nazir

Reputation: 840

If you are using PyCharm or any other IDE, then you have to install 'sklearn' separately in PyCharm tool too. In My Case I am using PyCharm, select

File Menu-> Default Settings-> Project Interpreter -> Press + button and type 'sklearn'

Press install button. Installation will be done in 10 to 20 seconds.

2nd option is if you already installed 'sklearn' using terminal then you have to set path in your PyCharm IDE.

Upvotes: 2

PhuTV
PhuTV

Reputation: 51

The Ubuntu 14.04 package is named python-sklearn (formerly python-scikits-learn) and can be installed using the following command: sudo apt-get install python-sklearn

Upvotes: 5

optimist
optimist

Reputation: 1018

Looks like you haven't installed scikit-learn properly. pip install -U scikit-learn should do the job. Also, I would suggest downloading the Anaconda distribution of python if you're planning to use python for kaggle contests. It takes care of all the necessary dependencies and contains all the commonly needed python packages for the contest. I found that easier than the tedious download of the dependencies. Here's the Link

Upvotes: 27

Related Questions