I have a couple different versions of Python installed on my Mac. The default version is 2.5, so when I install a module it gets installed to 2.5. I need to be able to install some modules to a different version of Python because I am working on projects that use different versions. Any one know how to accomplish this? Thanks for your help.
If you're installing using setup.py, just run it via the appropriate version of Python, e.g.:
If you're using easy_install there should be a version for the corresponding Python version called easy_install-N.N, e.g.
If you're working on different projects that require different versions of Python, consider using virtualenv (and virtualenvwrapper) - it allows you to fire up and use multiple environments each with its own version of Python and set of libraries. Example usage would be something like:
To go back to the foo environment later, use
So you can use virtualenv to maintain separate environments for each version of Python you have installed. Within those environments, pip and easy_install just do the right thing. |
|||||||||
|
If you've installed them using macports then you run (as root):
Hint: To list available versions run:
Otherwise you can set the You will also need to update the I strongly recommend to install all the versions using a package manager (homebrew, macports, fink, etc.) so they'll be easier to manage. |
|||||||||
|
If you're installing through setuptools (ie |
|||
|
easy_install
when different versions of python, installed with macports ara available, see stackoverflow.com/questions/5792060/… – juanchopanza Jun 3 '11 at 7:18