Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named sklearn.feature_extraction.text

Tags:

python

pacman

I use from python 2.7 and pacman package manager, and install sclearn with it. but when i have an ImportError:

>>> from sklearn.feature_extraction.text import TfidfVectorizer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named sklearn.feature_extraction.text

How i can fix this error?

like image 683
Vahid Kharazi Avatar asked Jul 21 '14 17:07

Vahid Kharazi


1 Answers

For python 2, you should be able to use this command to install using pacman:

pacman -S python2-scikit-learn

Make sure the package name has the number "2" in it.

As per scikit-learn's installation guide, another way to install it is using pip:

pip install --user --install-option="--prefix=" -U scikit-learn

like image 94
Nadine Avatar answered Sep 17 '22 10:09

Nadine