Lots of python libraries fail to install or fail to work under 64 bit python. Here’s a cheesy non-programmatic hack to make 32-bit python the default.
1. Find the path to the python installation you want to default to 32-bit mode in your .bash_profile
nano .bash_profile
Mine is at /Library/Frameworks/Python.framework/Versions/2.7/bin
2. Go to the python installation in Finder. Observe the aliases (shortcuts / symlinks) to various python configurations. If you’re not sure what you’re looking for, stop and go find out about aliases and symlinks, what they are, and what they look like in OS X (obligatory “don’t proceed if you don’t know what you’re doing”).
3. Rename the alias called “python” to “python-64″. There is no existing alias with that name because “python” defaults to the 64-bit configuration whenever possible.
4. Right click “python-32″ or, if you prefer, “python2.7-32″ (which is not an alias, but is what the alias points to). Select “Make Alias”. Rename the new alias “python”.
5. Now any time you type “python” in the Terminal, 32-bit python will start. Even better, when other programs start python in various ways, or the python launcher starts, they will default to 32-bit python.
6. If you ever want to go back and default to 64-bit again, just delete your python alias and remove “-64″ from “python-64″.
By the way, don’t believe what you read in the man pages about this stuff:
# this doesn't work! defaults write com.apple.versioner.python Prefer-32-Bit -bool yes # neither does this! export VERSIONER_PYTHON_PREFER_32_BIT=yes
The Mac versioner stuff only applies to the Mac pre-installed python. It will not have any effect on your python 2.7 installation!
And one final caveat. If you’ve installed libraries under 64-bit python, you might get a “wrong architecture” error running in 32-bit mode. You can either run those programs under 64-bit, or assuming you can install 32-bit configurations of your libraries, do that.