Created
November 23, 2011 16:32
-
-
Save crankycoder/1389144 to your computer and use it in GitHub Desktop.
Changing Python version properly on OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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