In reading about virtualenv here I realized I didn't have pip 1.3+, so I ran pip install --upgrade pip
and now when I run pip --version
i get the following:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/pkg_resources.py", line 2807, in <module>
parse_requirements(__requires__), Environment()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/pkg_resources.py", line 594, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.2.1
If it helps, or is at all relevant, my $PATH
looks like this:
/usr/local/bin:/usr/local/share/python:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
Also, which pip
gives me /usr/local/bin/pip
.
Not sure what to do about the error. Thanks.
I happened to get to a similar state after upgrading from OS X Lion to Mountain Lion today.
The other proposed solutions either do not work, or replace the Apple version of Python with the brew version, which I'm not sure is what saclark asked for.
What I did to get it fixed is install
distribute
manually, thus gettingeasy_install
back to work, and then installpip
with it.The commands are:
If the link does not work, you can alway find newer versions of distribute here.
As an aside, there's an easier way to do it (I just encountered this).
Edit
/usr/local/bin/pip
and change the references to version number (so below you'd want to change '1.5.6' to whatever version number you're using):then you may be completely good at that point.
I wanna find out at where pip 1.2.1 is required, but I don't have so much time... so I just downgrade pip to 1.2.1. It can't be helped for a while, till pip or distribute package is modified.
How to do this? just type this in console(I hope your distribute package is well):
The correct way to fix modern version (6.x) of pip in 2 steps
Delete the
pip
package in Python'ssite-package
. For Homebrew Python 2.7, do this:Follow the instructions on the official
pip
documentation site to reinstall it. For short:For
pip
6.x, there's no need to install the legacydistribute
package. Justsetuptools
, which will be installed by default via theget-pip.py
script mentioned above.Hm.. puzzling. Wonder where that 1.2.1 comes from. Just out of curiosity, could you post the contents of /usr/local/bin/pip? Should only be a couple of lines.
You could try updating pip (again) with distribute, and maybe also distribute itself..
I got similar problem today. After some research, I solved it by reinstalling pip using this:-
Hope somebody would find it helpful.