Search code examples
pythonmacospipeasy-install

pip install for Multiple Python Distributions on Mac


I am fine having multiple distributions of Python on my system, given the advice found here.

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

This is a problem because both my default python calls and XCode compiles are associated with /usr/bin/python.

So, for example, when I try to pip install appscript, I get back a cheeky

Requirements already satisfied

But, then, when I open up python or XCode and try to import appscript, I get

ImportError: No module named appscript

How do I force pip to install to whatever distribution is associated with /usr/bin/python?


Solution

  • It turned out that easy_install (and pip) was not associated with Python 2.7 (the version used by my default python and XCode). Per vartec's instructions on an Answer that has now been 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 doing this, my default call to easy_install suddenly switched to installing packages for the distribution used by python and XCode.

    Both python and XCode have access to appscript now, so whatever, I guess. Thanks for the help everyone, especially vartec.