Snowberry + wxPython 2.8 + Ubuntu 12.04

15 July 2013
The original motive for this was getting Snowberry (the GUI for the Doomsday Engine), but the mechanics of the process involved are pretty generic for anyone wanting to run Python programs that use wxPython features not in the wxPython version that Ubuntu 12.04 ships with. Python software is a bit of a nightmare when it comes to different versions, and I suspect Ubuntu has stuck with wxPython 2.6 to avoid breaking other software, and annoyingly does not present any easy way to have multiple versions side-by-side.

The general approach (which I have used previously) is to do a home directory install of both Python, and then add to it the wxPython libraries. There are alternative methods, but when messing around with Python, using isolated custom-compiled copies of the interpretor means that there are no nasty surprises resulting from stale binary repositories.

Building all the software

I will be assuming a build directory named wxSrc, and that Python 2.7.5 and wxPython 2.8.12.1 have been downloaded into the ~/Downloads/ directory. Far as I am aware wxPython includes the entire wxWidgets distribution, so there's no need to get wxWidgets seperately even if you want to play around with some of the options.
The instructions for building wxWidgets/wxPython are based on those given in wxPython-src-2.8.12.1/wxPython/docs/BUILD.html, with changes mainly to reduce the number of environment variables needed when running. Although /home/remy/ is used here, I assume that anyone with the knowledge to understand these instructions will know how to make any necessary changes for their own home directory.

Build Python 2.7.5

Build wxWidgets

There's problems getting wxWidgets to pick up the OpenGL libraries, which I think is down to where the OpenGL libraries are located on 64-bit versions of Ubuntu. To my knowledge this is fault in wxWidgets' configure script, and for now found it easiest to simply disable OpenGL support.

Build & install wxPython

If you get a compile error soon after running setup.py, it is mostly likely due to a problem of wx-config not being picked up. The last two lines are a manual installation of the wxPython files into the Python library path, which is an alternative to using the PYTHONPATH environment variable.

Testing wxPython

If all is well, you should be able to run the wxPython widgets gallery:

cd demo
python demo.py

Note: Demo directory is wxSrc/wxPython-src-2.8.12.1/wxPython/demo

Cleaning up

If all went well, Python/wxWidgets/wxPython are now all installed under ~/wxPython2.8 and the wxSrc directory can now be deleted. To use wxPython, you just need to set your enviornment variables to pick up the correct binaries: