3

I am unable to install any python package through

pip install <name>

it always throws the error

Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-V2srLa/Gensim
Storing debug log for failure in /home/<username>/.pip/pip.log

for other packages using sudo apt-get install python-<name> used to work but not for gensim

I have tried to insttall/unzip the package and go python setup.py test python setup.py install it throws pkg_resources.DistributionNotFound: The 'ruamel.yaml>=0.10.7' distribution was not found and is required by the application

I have tried to install 'ruamel.yaml>=0.10.7' and it still doesn't work

Any help why this is failing ? and how can I solve it ?

Update: moving to root (sudo su) worked for me

Anthon
  • 69,918
  • 32
  • 186
  • 246
severine
  • 305
  • 1
  • 3
  • 11

2 Answers2

1

If you have stumbled upon this question, the best answer is to install gensim and other packages using a virtual environment, not to use sudo or root. See Is it acceptable and safe to run pip install under sudo?, as well as https://towardsdatascience.com/all-you-need-to-know-about-python-virtual-environments-9b4aae690f9, and https://realpython.com/python-virtual-environments-a-primer/

Matt L.
  • 3,431
  • 1
  • 15
  • 28
0

If you use the system pip to install ruamel.yaml you don't have enough privileges to write into /usr/lib/python2.7/site-packages. In that case either use sudo, or install the ruamel.yaml package using:

sudo apt-get install python-ruamel.yaml

(using sudo pip install ruamel.yaml will get you a newer version)

Anthon
  • 69,918
  • 32
  • 186
  • 246
  • trying this get's me the errors : E: Unable to locate package python-ruamel.yaml E: Couldn't find any package by regex 'python-ruamel.yaml' – severine Mar 30 '16 at 09:30
  • @severine Sorry, it looks like it was not yet included in the standard 15.10 repositories. `python-ruamel.yaml` is in 16.04/xenial – Anthon Mar 30 '16 at 09:38