Pip for multiple Python distributions on Mac

I am glad that I have several Python distributions on my system, given the tips found here .

However: I cannot get easy_install and pip install to install into the distribution associated with /usr/bin/python on Mac. They will only install modules in the distribution associated with /Library/Python/2.6/ .

This is a problem, because both my default python calls and Xcode compilation are related to /usr/bin/python .

So for example, when I try pip install appscript , I return sassy

Requirements already satisfied

But then when I open python or Xcode and try import appscript , I get

ImportError: No module named appscript

How to force install pip for installation in any distribution related to /usr/bin/python ?

+4
source share
2 answers

It turned out that easy_install (and pip ) was not associated with Python 2.7 (the default version used by python and XCode). Per vartec in the answer that was deleted, I downloaded and installed easy_install for the correct version of python:

sh setuptools-0.6c11-py2.7.egg

( easy_install is part of setuptools )

After that, my default call easy_install unexpectedly switched to installing packages for the distribution used by python and Xcode.

Both python and Xcode now have access to appscript , therefore, however. Thanks for helping everyone, especially vartec .

+4
source

You must invoke the correct version of easy_install or pip. One way to do this is to install the version you want to work with on your way:

  export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH 

This works for easy_install . For pip you need to provide the python environment to the pip command:

 pip install -E /Library/Python/2.6/ appscript 
+1
source

All Articles