Can't use pip anymore
Asked Answered
T

2

5

When I try to use pip, I met this error:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==1.0.2', 'console_scripts', 'pip')()
  File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.21-py2.6.egg/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.21-py2.6.egg/pkg_resources.py", line 2281, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.21-py2.6.egg/pkg_resources.py", line 1996, in load
    raise ImportError("%r has no %r attribute" % (entry,attr))
ImportError: <module 'pip' from '/usr/lib/pymodules/python2.6/pip/__init__.pyc'> has no 'main' attribute

Obviously, I made some change to the system that broke pip. But I've no idea what it is. What might cause the exception above?

Edit:

What I can guess is that this morning, I crated a virtualenv, installed a package written by myself by running:

python setup.py install

in that environment.

BTW, I did try to reinstall pip by running get-pip.py, didn't work

Tarn answered 20/8, 2011 at 19:15 Comment(2)
can you re-install pip with easy_install? I don't think anyone's going to be able to guess what "change to the system" you might have made; you almost certainly don't want to be manually changing anything in /usr/lib/pymodules.Lucilla
I didn't do anything manually in pymodules.Tarn
M
8

I note that distribute is installed in /usr/local but pip is in /usr/lib, so I'm guessing that you have an older version of pip installed system wide that is somehow overriding what you're easy_installed or piped. I'd start looking there.

Mithras answered 20/8, 2011 at 19:37 Comment(2)
Yeah, I've got a system wide pip, but this morning I also installed on in virtualenv as I thought it didn't matter. So how can I get rid of the one in /usr/local? Just delete it?Tarn
Thanks, I deleted the installation in /usr/local, everything goes fine now.Tarn
T
3

Reinstall using easy_install. Close the terminal and reopen. Pip should now work.

Tameika answered 29/12, 2012 at 6:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.