A quick shift between standard python
versions on OSX
$: defaults write com.apple.versioner.python Version 2.5
$: python -V
# [ Output ]
# Python 2.5.6
$: defaults write com.apple.versioner.python Version 2.7
$: python -V
# [ Output ]
# Python 2.7.5
System-wide python
Preferences
This preferences for python-apple
are set on User basis. To set the default python version system wide, we write into /Library/Preferences/com.apple.versioner.python
. You must be admin
to do so.
$: sudo defaults write /Library/Preferences/com.apple.versioner.python Version 2.5
If we decide to set the default python
version system-wide, we should be able to define a user-specific python
default version as well.
The environment variable VERSIONER_PYTHON_VERSION
We can use the environment variable VERSIONER_PYTHON_VERSION
in addition to our preferences. This environment variable takes precedence over settings in preferences files!
$: export VERSIONER_PYTHON_VERSION=2.5
$: python -V
# [ Output ]
# Python 2.5.6
pyenv
. – fjarri Oct 14 '13 at 0:20