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/easy_install.py'

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/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


user@localhost[~]%sudo python /Library/Python/2.7/site-packages/easy_install.py paramiko
Searching for paramiko
Reading http://pypi.python.org/simple/paramiko/
Reading http://www.lag.net/~robey/paramiko/
Reading http://www.lag.net/paramiko/
Best match: paramiko 1.7.7.1
Downloading http://www.lag.net/paramiko/download/paramiko-1.7.7.1.zip
Processing paramiko-1.7.7.1.zip
Running paramiko-1.7.7.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-NHsXZs/paramiko-1.7.7.1/egg-dist-tmp-7ctqzo
zip_safe flag not set; analyzing archive contents...
Adding paramiko 1.7.7.1 to easy-install.pth file


Installed /Library/Python/2.7/site-packages/paramiko-1.7.7.1-py2.7.egg
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