Monday, January 30, 2012

python easy_install on Mac OS X Lion

easy_install seems broken on Mac OS X Lion, as of 10.7.2. From what I've seen on the web, it's not just me.

While calling the easy_install script in /usr/bin fails, running the script under /Library/Python/…. works fine.

You can create an alias and add it to your .bashrc:

user@localhost[~]%grep easy ~/.bashrc 
alias easy_install='sudo python /Library/Python/2.7/site-packages/'

user@localhost[~]%source ~/.bashrc

A better solution would be for Apple to fix their shit.

user@localhost[~]%sudo /usr/bin/easy_install paramiko
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/”, line 2607, in parse_requirements(requires), Environment() File “/Library/Python/2.7/site-packages/”, line 565, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: setuptools==0.6c12dev-r85381

user@localhost[~]%sudo python /Library/Python/2.7/site-packages/ paramiko
Searching for paramiko
Best match: paramiko
Running paramiko- -q bdist_egg --dist-dir /tmp/easy_install-NHsXZs/paramiko-
zip_safe flag not set; analyzing archive contents...
Adding paramiko to easy-install.pth file

Installed /Library/Python/2.7/site-packages/paramiko-
Processing dependencies for paramiko
Finished processing dependencies for paramiko

# Updated: 2012-3-17 - I guess I'm behind the times. pip seems to be the better tool for the job.
Post a Comment