user4584333
user4584333

Reputation:

ImportError: No module named sklearn.preprocessing

I installed scikit-learn successfully on Ubuntu following these instructions.

However, I get this error when I run a program that uses it:

Traceback (most recent call last):
  File "begueradj.py", line 10, in <module>
    from sklearn.preprocessing import normalize
ImportError: No module named sklearn.preprocessing

How do I fix this?

Upvotes: 8

Views: 36093

Answers (2)

Jhon
Jhon

Reputation: 619

I resolved the issue by running this command in terminal:

sudo apt-get install python-sklearn  

Upvotes: 2

user4632747
user4632747

Reputation:

The instructions given in that tutorial you linked to are obsolete for Ubuntu 14.04.

The Ubuntu 14.04 package is named python-sklearn (formerly python-scikits-learn):

sudo apt-get install python-sklearn  

The python-sklearn package is in the default repositories in Ubuntu 14.04 as well as in other currently supported Ubuntu releases.

Upvotes: 6

Related Questions