As of writing the official release of the wxPython is version 2.8 which one could use apt-get install:
sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-dev
However, in my case, I need to use the WebView and it is available in version 2.9. This is the reason why I have to build and install wxPython 18.104.22.168 from source.
Download and Patch Source
cd ~ wget "http://downloads.sourceforge.net/project/wxpython/wxPython/22.214.171.124/wxPython-src-126.96.36.199.tar.bz2" wget "http://downloads.sourceforge.net/project/wxpython/wxPython/188.8.131.52/wxPython-src-184.108.40.206.patch" tar xvjf wxPython-src-220.127.116.11.tar.bz2 patch -p 0 -d wxPython-src-18.104.22.168/ < wxPython-src-22.214.171.124.patch mkdir wxPython-src-126.96.36.199/bld
sudo apt-get install dpkg-dev build-essential swig python-dev libwebkit-dev libjpeg-dev libtiff-dev checkinstall freeglut3 freeglut3-dev libgtk2.0-dev libsdl1.2-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgconf2-dev libglapi-mesa libosmesa6 libglu1-mesa-dev libglu1-mesa mesa-common-dev
Note that I install mesa as well since wxPython requires OpenGL and mesa packages include OpenGL headers. Also, some packages above may not necessary but I install then since I was not sure.
Build and Install
This step takes hours (~8 hours).
cd wxPython-src-188.8.131.52/wxPython python build-wxpython.py --build_dir=../bld --install
Note: make sure that python command that you use matches the version of the python that you are planning to use with wxPython. You may check the version by
The wx modules are placed under /usr/local/lib but when I run demo.py it does not recognize wx since modules were misplaced. I copy all the wx modules under /usr/local/lib to /usr/lib
sudo cp /usr/local/lib/libwx_* /usr/lib
Now you can try the demo under