13

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?

0

3 Answers 3

27

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

Sign up to request clarification or add additional context in comments.

Comments

5

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

Comments

2

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.