Im trying to install gensim using pip but i'm getting:
"Could not import setuptools which is required to install from a source distribution.
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 377, in setup_py
import setuptools # noqa
File "/Library/Python/2.7/site-packages/setuptools/__init__.py", line 11, in <module>
from setuptools.extern.six.moves import filterfalse, map
File "/Library/Python/2.7/site-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
ImportError: No module named extern"
Other posts have suggested running
pip install -U setuptools
which reports to have successfully installed the package.
Installing collected packages: setuptools
Successfully installed setuptools-21.0.0
However, running the gensim pip install command:
pip install gensim
just gives the first error again.
any ideas why this might be happening?
Even in a vanilla version of Python 3.7. 6 (installed via pyenv ), the packages installed by default are both pip and setuptools .
The recommended way to install setuptools on Windows is to download ez_setup.py and run it. The script will download the appropriate . egg file and install it for you. Once installation is complete, you will find an easy_install program in your Python Scripts subdirectory.
Setuptools is a package development process library designed to facilitate packaging Python projects by enhancing the Python standard library distutils (distribution utilities). It includes: Python package and module definitions.
I had a very similar issue when installing SciPy Stack.
Try to use: pip install --user setuptools
Instead of using: pip install -U setuptools
I had a similar error with another library. It took me two steps, but it could be overkill.
# apt-get install python-setuptools
# pip install -U setuptools
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With