Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
830 views
in Technique[技术] by (71.8m points)

macos - Python pip broken after OS X 10.8 upgrade

Made the upgrade to Mac OS X 10.8 (Mountain Lion) and get now the following error when trying to call $ pip:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: pip==1.1

Update: Tried to reinstall by doing the install procedure again (with http://www.pip-installer.org/en/latest/installing.html#using-the-installer and easy_install), but didn't work, got the same error.

Tried now the following: Calling $ sudo pip and the above error disappears. Strange is, that the directories which could not befound in the above error message point to /System/Library/... while the python installation is (new ?) to find in /Library/Frameworks/..:

$ which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python

Any idea how to get rid of the sudo?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use easy_install to update your pip to the latest version:

sudo easy_install -U pip

Also make sure you have the lastest XCode installed (ver 4.4) with Command Line Tools.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...