Skip to main content

Wxpython 2.9 on Linux

·180 words·1 min
Martin Rønn
Author
Martin Rønn
Carpenter and software developer based in Denmark doing carpentry, software development, 3D printing, CAD, self-hosting and much more.

I needed to test one of my programs on Linux. It’s written in Python using wxPython. I am using the version that is still in development wxPython 2.9. There are prebuild versions for Mac and Windows but unfortunately, there isn’t a prebuild package for Linux so I had to compile it myself. However I ran into some problems making it compile, and since others might have similar problems I’ll think I would document it.

Download the wxpython 2.9 source here

First, there is a problem with the wxPython 2.9.4 that makes the compile fail. Someone has made a patch to fix this. It can be downloaded
here

To apply the patch change to the root folder of the wxPython source tree and run

patch -p0 < wxPython-src-2.9.4.1.patch

Install the necessary packages for wxPython to compile and function

sudo apt-get install build-essential libgtk2.0-dev freeglut3-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev python2.7-dev libwebkitgtk*

Compile and install wxPython

cd wxpython
./build-wxpython.py  
sudo ./build-wxpython.py --install
sudo ldconfig

If everything finish without errors you can test if wxPython was correctly installed with the following.

import wxversion
wxversion.select('2.9')
import wx

Related

SSH Port Forwarding
·409 words·2 mins
Zim Desktop Wiki Note Taking the Awesome Way Part Two
·278 words·2 mins
Zim Desktop Wiki - Note Taking the Awesome Way Part One
·373 words·2 mins