Mac OS X 10.7 “Lion” Seems to Have a Broken Python easy_install

One of the first things I needed after upgrading to Mac OS X 10.7 (Lion) was to make some Python scripts work. However easy_install seemed to be broken:

$ easy_install psycopg2
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==0.6c12dev-r88795
I fixed this by installing Distribute and then the new Mac OS X Developer Tools.

 

8 thoughts on “Mac OS X 10.7 “Lion” Seems to Have a Broken Python easy_install

  1. Pingback: Macdrifter » Blog Archive

  2. Banchali

    The system easy_install is not in /usr/local, it’s /usr/bin. There are zero OSX components in /usr/local unless installed by a user. You (or other code you installed) installed that one. Presumably you removed (or updated) the setuptools associated with that script (or updated Python versions), and the setuptools install (by default /Library/Python/X.Y/site-packages) is either missing or a different version.

  3. Rowland

    I installed Distribute and have the new Mac OS X Developer Tools but don’t know how to proceed from there. I am trying to install the GoogleCL so I can interact with my Google Calendar from the command line but I get the same error as you have above. Any thoughts?

  4. Beau Taub

    I ran into a similar issue myself. It looks like calling the easy_install script in /usr/bin fails, but calling the script under /Library/Python/…. works fine.

    sh[~]%sudo /usr/bin/easy_install Traceback (most recent call last): File “/usr/bin/easy_install-2.7″, line 7, in from pkg_resources import load_entry_point File “/Library/Python/2.7/site-packages/pkg_resources.py”, line 2607, in parse_requirements(requires), Environment() File “/Library/Python/2.7/site-packages/pkg_resources.py”, line 565, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: setuptools==0.6c12dev-r85381

    sh[~]%sudo python /Library/Python/2.7/site-packages/easy_install.py error: No urls, filenames, or requirements specified (see –help)

  5. Pingback: pip install broken | My Blog

  6. Pingback: From here to there » easy_install and MacOSX

  7. Jon

    Removing the easy_install distribution from /usr/local/bin worked for me after I installed the Command Line Tools from the Apple Developer site.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>