2

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?

3
  • How you installed pip? and the contents of the log file?
    – Braiam
    May 1, 2014 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).
    – belacqua
    May 3, 2014 at 3:55
  • askubuntu.com/questions/429417/… seems to have it solved in comments.
    – Rinzwind
    May 3, 2014 at 6:47

3 Answers 3

1
sudo apt-get install python-setuptools
2
  • 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, 2014 at 0:06
  • and when you installing setuptools via pip, what is happening? sudo pip install setuptools Apr 20, 2014 at 0:33
1

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.

0

First of all install python-setuptools

apt install python-setuptools

then try

easy_install glances

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .