Python easy_install unter Mac OS X verwirrt

18949
slf

Umgebungsinformationen:

$ which python /usr/bin/python $ python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)  [GCC 4.2.1 (Apple Inc. build 5646)] on darwin  $ echo $PATH /opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin:/opt/local/bin:/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:~/.utility_scripts  $ which easy_install /usr/bin/easy_install 

Probieren wir das simplejson-Modul aus (ich weiß, es ist dasselbe wie import json in 2.6, aber das ist nicht der Punkt)

$ sudo easy_install simplejson Searching for simplejson Reading http://pypi.python.org/simple/simplejson/ Reading http://undefined.org/python/#simplejson Best match: simplejson 2.1.0 Downloading http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.0.tar.gz#md5=3ea565fd1216462162c6929b264cf365 Processing simplejson-2.1.0.tar.gz Running simplejson-2.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Ojv_yS/simplejson-2.1.0/egg-dist-tmp-AypFWa The required version of setuptools (>=0.6c11) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U setuptools'.  (Currently using setuptools 0.6c9 (/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python)) error: Setup script exited with 2 

Okay, also werde ich setuptools aktualisieren ...

$ sudo easy_install -U setuptools Searching for setuptools Reading http://pypi.python.org/simple/setuptools/ Best match: setuptools 0.6c11 Processing setuptools-0.6c11-py2.6.egg setuptools 0.6c11 is already the active version in easy-install.pth Installing easy_install script to /usr/local/bin Installing easy_install-2.6 script to /usr/local/bin  Using /Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg Processing dependencies for setuptools Finished processing dependencies for setuptools 

Ich werde nicht spekulieren, aber dies könnte durch eine Reihe von Umgebungsänderungen wie das Leopard-> Snow Leopard-Upgrade, MacPorts- oder Fink-Updates oder mehrere Google App Engine-Updates verursacht worden sein.

3

2 Antworten auf die Frage

3
alcoholiday

Ich habe die Anweisungen auf der folgenden Website befolgt, wodurch das Problem für mich gelöst wurde:

http://pypi.python.org/pypi/setuptools

Laden Sie die entsprechende Python-Version herunter und führen Sie dann Folgendes aus:

sh ./setuptools-0.6c11-py2.7.egg 
1
Eli James

Standardmäßig verwendet OSX / usr / bin / easy_install für die Installation von Paketen von Drittanbietern. Dieses Skript ist hartcodiert, um eine Version von Setuptools zu verwenden, die älter ist als die von Pymongo für die Python2.7-Unterstützung erforderliche Version. Sie können es so umgehen:

$ easy_install -U setuptools $ python -m easy_install pymongo 

Um ein Upgrade durchzuführen:

$ python -m easy_install -U pymongo