Skip to content

Instantly share code, notes, and snippets.

@crankycoder
Created November 23, 2011 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crankycoder/1389144 to your computer and use it in GitHub Desktop.
Save crankycoder/1389144 to your computer and use it in GitHub Desktop.
Changing Python version properly on OSX
Apple has provided two very simple ways to change the default python on OS X 10.6 Snow Leopard and 10.7 Lion. It's all detailed in the Apple man page for python(1):
$ man python
$ which python
/usr/bin/python
$ python -V
Python 2.7.1
#
# temporarily change version
#
$ export VERSIONER_PYTHON_VERSION=2.6
$ python -V
Python 2.6.6
$ unset VERSIONER_PYTHON_VERSION
$ python -V
Python 2.7.1
#
# persistently change version
#
$ defaults write com.apple.versioner.python Version 2.6
$ python -V
Python 2.6.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment