Easy_install and Broken Setuptools on OS X

After upgrading to Mountain Lion, easy_install seemed to be borked. On running it, this happened:

$ easy_install Pygments
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-r85381

I cursed Apple for breaking things again, but it turns out it was my fault. Something had installed a version of easy_install in /usr/local/bin/ which was shadowing the correct one in /usr/bin/. Silly me.

The solution? Delete /usr/local/bin/easy_install and all becomes right with the world. I also had /usr/local/bin/easy_install-2.7 which met a similar fate in the fiery jaws of rm. I should probably re-install OS X sometime to decrustify it a bit after all the random shite I’ve inflicted on it over the years.