ImportError: no module named sklearn.feature_extraction.text

I use of the Package Manager python 2.7and pacmanand set him sclearn. but when I have 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 can I fix this error?

+4
source share
2 answers

For python 2, you can use this command to install using pacman:

pacman -S python2-scikit-learn

Make sure the package name is "2".

According to the scikit-learn installation guide , another way to install it is to use pip:

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

+4
source

Ubuntu Linux , apt-get, pip, scikit-learn . . :

1. , apt-get .
sudo apt-get

2.
sudo apt-get install build-essential python-dev python-setuptools python-numpy python-scipy libatlas-dev libatlas3gf-base

3: Scikit Learn
pip install --user --install-option = "- prefix =" -U scikit-learn

, !

+6

All Articles