User Tools

Site Tools


python:installwxpython

HOWTO INSTALL WXPYTHON FROM THE SOURCES

19.01.2009

Installing wxPython from the sources is not very complicated, but there are some issues you must take care of, so here we go:

1. Grab the sources

…from WxPython.org

2. Unpack and configure

Assumed that you already have installed python and gtk+, untar into a directory. Assume here /usr/src/wxPython-src-2.8.9.2
Create a new folder inside this called bld.

cd /usr/src/wxPython-src-2.8.9.2/bld
../configure --enable-unicode --prefix=/opt/wx/2.8

3. After configure, compile and install the sources.

It's important to go to other directories and compile also as shown here (otherwise you'll get many long lines of errors in the next step). For this, put the following inside a text document called .make and set execute bit on it (chmod +x .make)

make $* \
    && make -C contrib/src/gizmos $* \
    && make -C contrib/src/stc $*

Next compile and install:

./.make
./.make install

After building, you'll have a set of wxWidgets files in /opt/wx/2.8

4. Last step, put these into site-packages folder

…of your python installation (e.g. /usr/local/lib/python2.6/site-packages/)
Just make sure that you call here the right python executable (if you have many python versions, call the one you install for - e.g. python2.6)

cd ../wxPython ← this is inside source folder (wxPython-src-2.8.9.2 in our example)
python2.6 setup.py install WX_CONFIG=/opt/wx/2.8/bin/wx-config UNICODE=1 BUILD_GLCANVAS=0

5. (Optional)Check for succesful import

python ← opens the interactive shell (or ipython if available)
import wx
wx.version()

If you get errors, check to have LD_LIBRARY_PATH set to /opt/wx/2.8/lib.

export LD_LIBRARY_PATH=/opt/wx/2.8/lib

python/installwxpython.txt · Last modified: 2013/03/16 17:40 (external edit)