On this help page
http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/python.1.html
Apple says:
CHANGING THE DEFAULT PYTHON
Using
% defaults write com.apple.versioner.python Version 2.5
will make version 2.5 the user default when running the both the python and pythonw commands (versioner is the internal name of the version-selection software used).
This simply doesn't work!
tppllc-Mac-Pro:~ swirsky$ python --version
Python 2.7
tppllc-Mac-Pro:~ swirsky$ defaults write com.apple.versioner.python Version 2.5
tppllc-Mac-Pro:~ swirsky$ python --version
Python 2.7
and neither does the switch to make 32-bit python the default
64-BIT SUPPORT
Version 2.6 supports 64-bit execution (which is on by default). Version 2.5 only supports 32-bit execution.
Like the version of Python, the python command can select between 32 and 64-bit execution (when both are available). Use:
% defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
to make 32-bit execution the user default (using
/Library/Preferences/com.apple.versioner.python
will set the system-wide default). The environment variableVERSIONER_PYTHON_PREFER_32_BIT
can also be used (has precedence over the preference file):% export VERSIONER_PYTHON_PREFER_32_BIT=yes #
Bourne-like shells or
% setenv VERSIONER_PYTHON_PREFER_32_BIT yes #
C-like shells
I'm down a rathole here. I'm trying to get wxpython to run. But it won't run on the Apple Python 2.7 because there's no 64-bit carbon support, and cocoa support isn't finished in wx yet.
=== UPDATE ===
Thanks for all your help! The mystery's been solved. One thing that confused me is I had no trouble running (32-bit) wxpython on my laptop (a recent i5 macbook pro), but it wouldn't run on my desktop (a recent i7 mac pro).
They both had python 2.7, and I assumed it was the same. But it wasn't!
The Mac Pro had the x86_64 build
tppllc-Mac-Pro:~ swirsky$ file `which python`
/Library/Frameworks/Python.framework/Versions/2.7/bin/python: Mach-O universal binary with 3 architectures
/Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture i386): Mach-O executable i386
/Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture ppc7400): Mach-O executable ppc
/Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64
and the laptop didn't:
thrilllap-2:thrillscience swirsky$ file `which python`
/Library/Frameworks/Python.framework/Versions/2.7/bin/python: Mach-O universal binary with 2 architectures
/Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture ppc): Mach-O executable ppc
/Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture i386): Mach-O executable i386
I'll re-install the one without the x86_64 version on my desktop machine, as I don't need 64-bit support yet.