Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

broken easy_install and pip after upgrading to OS X Mavericks

Upgraded to OS X 10.9 Mavericks and installed XCode, Command Line Tools, XQuartz, etc. Trying to run a pip install now, but it says that the distribution is not found:

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.4.1

So I tried to install pip with an easy_install. Turns out that's borked too:

Traceback (most recent call last):
  File "/usr/local/bin/easy_install", 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 2607, in <module>
parse_requirements(__requires__), Environment()
  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: setuptools==1.1.6

So some of the other threads say to reinstall setuptools with a sudo python ez_setup.py. It seems to work fine:

Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-1.1.6-py2.7.egg
Processing dependencies for setuptools==1.1.6
Finished processing dependencies for setuptools==1.1.6

But when running the easy_install pip, the same pkg_resources.DistributionNotFound: setuptools==1.1.6 error occurs. Anyone else have this problem? Any ideas how to fix this?

like image 950
qualia365 Avatar asked Jan 16 '14 01:01

qualia365


People also ask

Is easy_install deprecated?

easy_install, now deprecated, was released in 2004 as part of setuptools. It was notable at the time for installing packages from PyPI using requirement specifiers, and automatically installing dependencies.

Does Pip use setuptools?

pip is a higher-level interface on top of setuptools or Distribute. It uses them to perform many of its functions but avoids some of their more controversial features, like zipped eggs.


2 Answers

  1. Install easy_install:

    Download ez_setup.py module from https://pypi.python.org/pypi/setuptools

    $ cd path/to/ez_setup.py
    $ python ez_setup.py
    
  2. Install pip:

    $ sudo easy_install pip
    
like image 194
kylemclaren Avatar answered Sep 26 '22 02:09

kylemclaren


try sudo python -m easy_install pip

like image 38
Harry Lee Avatar answered Sep 25 '22 02:09

Harry Lee