Python pip broken after OS X 10.8 upgrade

Solution 1:

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.

Solution 2:

This works for me

rm -f /usr/local/bin/easy_install
brew reinstall python
pip install --upgrade setuptools
pip install --upgrade pip

Solution 3:

I had a similar error except that sudo pip did not work either. I am using a "brew" installation of python (which is symlinked to /usr/local/bin) and found that the problem was that the shebangs in the pip and easy_install files were hardcoded to #!/usr/bin/python instead of #!/usr/local/bin/python, and so was using the system python version instead of the brew version.

Cheers, Tom