An easy way to run wxpython on OS X Snow Leopard

As I'm sure a lot of Mac users have found out, wxpython is a bit of a pain. The reason being is by default it runs in 64-bit mode but wxpython is 32-bit. You can manually fix this by typing:export VERSIONER_PYTHON_PREFER_32_BIT=yes in your command line but obviously this is a pain. So what I've been doing is using a script that sets the variable for me and runs the script.

#! /bin/bash
# Usage: ./osx_launch.sh my_program.py
export VERSIONER_PYTHON_PREFER_32_BIT=yes
/usr/bin/python "$@"

That's all you need. Just copy and paste into Vim or another text editor and save it with the the name you want and set it to executable with chmod u+x osx_launch.sh (or whatever filename you use) and it's ready to go!

Just a quick note, obviously if you want to get out of 32-bit mode use and export VERSIONER_PYTHON_PREFER_32_BIT=no to go back.

Updated by toadwarrior on Jan. 29, 2012, 6:35 p.m.