Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm currently using Ubuntu 12.04 with pip version 1.0 and python version 2.7.

pip --version
pip 1.0 from /usr/lib/python2.7/dist-packages (python 2.7)

Unfortunately, since trying to upgrade one of the pip packages, I'm unable to install anything using pip. I'm getting the following error messages:

vince@hal:~$ sudo pip install glances
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 215, in run
    import setuptools
ImportError: No module named setuptools

Storing complete log in /home/vince/.pip/pip.log
vince@hal:~$ sudo pip install flexget
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 215, in run
    import setuptools
ImportError: No module named setuptools

Storing complete log in /home/vince/.pip/pip.log
vince@hal:~$

Anyone got any ideas?

share|improve this question
    
How you installed pip? and the contents of the log file? –  Braiam May 1 at 18:47
    
You might see if you have /usr/share/doc/python-pip/distribute_setuptools.rst on your system (mine came with python-pip). It explains a possible cause of this and gives a solution (which from a cursory look appears to be the same you found from the support ticket). –  belacq May 3 at 3:55
    
askubuntu.com/questions/429417/… seems to have it solved in comments. –  Rinzwind May 3 at 6:47

2 Answers 2

sudo apt-get install python-setuptools
share|improve this answer
    
Didn't work. I've already got it installed: vince@hal:~$ sudo apt-get install python-setuptools python-setuptools is already the newest version. 0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. –  Vince Apr 20 at 0:06
    
and when you installing setuptools via pip, what is happening? sudo pip install setuptools –  Valentin Kantor Apr 20 at 0:33
up vote 0 down vote accepted

Okay, I managed to get it working - hopefully this will help others in the future:

Found the following ticket:

http://flexget.com/ticket/21161

From here I used the following command:

This was because the upgrade somehow managed to remove the setuptools package from my python environment. Running the command below fixed setuptools and allowed me to use pip to uninstall and reinstall flexget.

curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | sudo python

Successfully installed flexget

Cleaning up...

vince@hal:~$ flexget -V

1.2.125

You are on the latest release.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.