Pip giving "ImportError: no module named setuptools", but I can import setuptools in a python interpreter

I get the setup on the new Mac and I hum, just install pip and some packages. When all of a sudden, every pip team that I try to run will throw

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 

I decided that I accidentally deleted the directory or something else, so I tried reinstalling setuptools, following the tips of the other answers on this site. I downloaded the setuptools egg from here and ran it as a shell script. Got this output:

 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 

Now, if I start an interactive python session, I can import setuptools without errors, but pip (and other command line scripts) complain that it is not installed. Any ideas why Python seems to find this, but not other scripts?

If this helps, here's what in 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 
+7
source share
1 answer

Your pip does not seem to be consistent with your Python. For comparison:

 File "/Library/Python/2.6/site-packages/pip-1.2.1-py2.6.egg/pip/basecommand.py", line 107, in main 

to

 Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg 

If python2.7 has setuptools then you should have

 /Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install-2.7 

and in this case

 easy_install-2.7 pip 

should provide you pip-2.7 .

+7
source

All Articles