Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX Mavericks broken pip and virtualenv

Upgraded to OSX Mavericks and everything broke. I have tried the "sudo easy_install pip" trick and it seems to pup pip somewhere else:

Best match: pip 1.4.1
Processing pip-1.4.1-py2.7.egg
pip 1.4.1 is already the active version in easy-install.pth
Installing pip script to /Library/Frameworks/Python.framework/Versions/2.7/bin
Installing pip-2.7 script to /Library/Frameworks/Python.framework/Versions/2.7/bin
Using /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

pip throws:

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.2.1
like image 224
holografix Avatar asked Nov 08 '13 11:11

holografix


3 Answers

Probably you have used easy_install to install pip and the mixture of both py package manage tools lead to the pkg_resources.DistributionNotFound problem. To fix it, run:

easy_install --upgrade pip
like image 146
Trein Avatar answered Oct 18 '22 14:10

Trein


I would highly recommend using Homebrew - http://brew.sh/ for installing Python on OSX. Pip and easy_install are setup properly and you will never have to use sudo to install any packages. That is one of the underlying principles of Homebrew that I love.

like image 1
William Denman Avatar answered Oct 18 '22 14:10

William Denman


After upgrading to Maverick, open Xcode. It should prompt you to re-install the necessary components of Command-Line Tools automatically.

Then use Homebrew to check: brew doctor

Will probably say CLT needs to be installed, in which case:

xcode-select --install should do it

like image 1
JLev Avatar answered Oct 18 '22 12:10

JLev