User Tools

Site Tools


python:installwxpython

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

python:installwxpython [2013/03/16 17:40] (current)
Line 1: Line 1:
 +==== 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 [[http://​wxpython.org/​download.php#​sources | 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**.
 +
 +<​code>​
 +cd /​usr/​src/​wxPython-src-2.8.9.2/​bld
 +../​configure --enable-unicode --prefix=/​opt/​wx/​2.8
 +</​code>​
 +
 +
 +=== 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)
 +
 +<code bash>
 +make $* \
 +    && make -C contrib/​src/​gizmos $* \
 +    && make -C contrib/​src/​stc $*
 +</​code>​
 +
 +Next compile and install:
 +
 +<code bash>
 +./.make
 +./.make install
 +</​code>​
 +
 +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)
 +
 +
 +<​code>​
 +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
 +</​code>​
 +
 +
 +=== 5. (Optional)Check for succesful import ===
 +
 +<code python>
 +python ← opens the interactive shell (or ipython if available)
 +import wx
 +wx.version()
 +</​code>​
 +
 +If you get errors, check to have LD_LIBRARY_PATH set to /​opt/​wx/​2.8/​lib.
 +<code bash>
 +export LD_LIBRARY_PATH=/​opt/​wx/​2.8/​lib
 +</​code>​
python/installwxpython.txt · Last modified: 2013/03/16 17:40 (external edit)