Switch Between Multiple Python’s Version Mac OSX

May 23, 2011 | By Regaz.

The easiest way to switch between several Python’s versions on Mac OSX is
of installing it by MacPorts and switching between them by python_select.
You can provide to install some Python’s versions like:

sudo port install python25
sudo port install python26
sudo port install python31

The New Guide to Easy Python Version Switching on Mac

After that you install the switcher:

sudo port install python_select

For activate the newly installed Macports Pythons you still need to
Give Precedence to Macports installing PATH (default /opt/local/bin) on the default one /usr/local/bin.
This is done by Adding at the end of your Bash Configuration’s file this:

PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PATH

Now activate your changes:

bash

To have a list of your newly installed environments:

python_select -l

Switching to python 3.1:

python_select python31

QuickChic Theme • Powered by WordPress