python - mac - Broken Easy Install y pip después de actualizar a OS X Mavericks
python 2 (3)
Instalar
easy_install
:Descargue el módulo
ez_setup.py
desde https://pypi.python.org/pypi/setuptools$ cd path/to/ez_setup.py $ python ez_setup.py
Instalar
pip
:$ sudo easy_install pip
Se actualizó a OS X 10.9 Mavericks e instaló XCode, Command Line Tools, XQuartz, etc. Intentando ejecutar una instalación pip ahora, pero dice que no se encuentra la distribución:
Traceback (most recent call last):
File "/usr/local/bin/pip", 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 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
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: pip==1.4.1
Así que intenté instalar pip con un easy_install. Resulta que eso también es falso:
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==1.1.6
Así que algunos de los otros subprocesos dicen que reinstalar setuptools con un sudo python ez_setup.py. Parece que funciona bien:
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-1.1.6-py2.7.egg
Processing dependencies for setuptools==1.1.6
Finished processing dependencies for setuptools==1.1.6
Pero cuando se ejecuta el pip easy_install, se produce el mismo error pkg_resources.DistributionNotFound: setuptools == 1.1.6. ¿Alguien más tiene este problema? Alguna idea de cómo solucionar este problema?
Me encontré con un problema similar con git-review
.
$ git review -s
Traceback (most recent call last):
File "/usr/local/bin/git-review", line 11, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 1132, in main
(os.path.split(sys.argv[0])[-1], get_version()))
File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 180, in get_version
provider = pkg_resources.get_provider(requirement)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 197, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
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: git-review
El equipo de git-review dijo que era un error con pkg_resources que podía solucionarse con
sudo pip install --upgrade setuptools
Esto funcionó bien para mi.
prueba sudo python -m easy_install pip