Je suis en train de configurer un nouveau mac et je fredonnais très bien, en installant pip et quelques paquets. Quand soudain, chaque commande pépin je vais essayer de courir jetteraitpip donnant "ImportError: Aucun module nommé setuptools" mais je peux importer setuptools dans l'interpréteur python
Exception:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.2.1-py2.6.egg/pip/basecommand.py", line 107, in main
status = self.run(options, args)
File "/Library/Python/2.6/site-packages/pip-1.2.1-py2.6.egg/pip/commands/install.py", line 248, in run
import setuptools
ImportError: No module named setuptools
je me suis dit que j'avais accidentellement supprimé un répertoire ou quelque chose, alors j'ai essayé de réinstaller setuptools, suivant les conseils de other answers sur ce site. J'ai téléchargé l'oeuf de setuptools de here et l'ai couru comme un manuscrit de coquille. Vous avez cette sortie:
Processing setuptools-0.6c11-py2.7.egg
Removing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install script to /Library/Frameworks/Python.framework/Versions/2.7/bin
Installing easy_install-2.7 script to /Library/Frameworks/Python.framework/Versions/2.7/bin
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
Maintenant, si je commence une session interactive de python, je peux import setuptools
sans erreur, mais pip (et d'autres scripts de ligne de commande) se plaignent qu'il est pas installé. Des idées pour lesquelles Python semble le trouver, mais pas d'autres scripts?
Si elle aide, voici ce qui est en sys.path
:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Notez que votre erreur de pip montre Python 2.6 dans la trace, mais le reste utilise Python 2.7 À quoi ressemble la ligne supérieure de votre script de niveau supérieur pip? – Keith