========================== INSTALLING wxPython from sources for LINUX ========================== Tested on ARCH linux and Debian linux (ARCH OF COURSE IS BETTER!!!! see www.archlinux.org) This howto is mainly from http://www.wxpython.org/BUILD.html with some minor amplification from me. Note: This will not destroy your existing older wxPython installation, you can later use either one. This example uses python2.3. It assumes you have reasonable knowledge of your computer, and how to change to root user, how to compile and install programs, that you have installed python. I've written this from memory so it could contain mistakes. Using these instructions you will: -download the wxPython sources -compile wxWidgits -compile wxPython -learn how to have your new wxPython live with your old wxPython If Interested, though it may confuse, you , read this page: http://www.wxpython.org/BUILD.html (you only need this page NOT THE INSTALL PAGE) if Using debian ensure the python-dev files are installed or it won't work! Step1: Download wxPython sources, documentation and demo files: - go to http://www.wxpython.org/download.php#binaries and scroll down the page to download: wxPythonDocs wxPythonDemo wxPythonSrc Step2 Untar the source code: address@hidden tar --directory /usr/src -xzvf wxPython-src-2.5.3.1.tar.gz address@hidden cd /usr/src/wxPython-src-2.5.3.1/ address@hidden export WXDIR=/usr/src/wxPython-src-2.5.3.1/ Step3: Create a build directory, make sure you are in $WXDIR, and change to bld directory address@hidden:/usr/src/wxPython-src-2.5.3.1/# mkdir bld address@hidden:/usr/src/wxPython-src-2.5.3.1/# cd bld address@hidden:/usr/src/wxPython-src-2.5.3.1/bld# Step4: Create a configure file and a make file to compile the source from: The configure file - cut and past this text and save as configure to the $WXDIR/bld/ directory as .configure (ie a fulltop followed by configure ie .configure). I think I changed the execute bit by typing chmod +x .configure after I saved the file. =====start of configure file==================== ../configure --prefix=/opt/wx/2.5-3-1 \ --with-gtk \ --with-opengl \ --enable-debug \ --enable-geometry \ --enable-sound --with-sdl \ --enable-display \ --enable-unicode \ --with-libjpeg=builtin \ --with-libpng=builtin \ --with-libtiff=builtin \ --with-zlib=builtin ===== end of configure file====================== The make file by cutting and pasting this text to the file make save to the $WXDIR/bld/ directory as .make (ie dot make ie .make), and doing a chmod +x (ie chmod +x .make) ====start of make file========================= make $* \ && make -C contrib/src/gizmos $* \ && make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" $* \ && make -C contrib/src/stc $* ======end of make file========================= Step5; Run .configure: address@hidden:/usr/src/wxPython-src-2.5.3.1/bld# ./.configure Step6 Run .make and .make install (and wait a fair while) address@hidden:/usr/src/wxPython-src-2.5.3.1/bld# ./.make (and go and have coffee) address@hidden:/usr/src/wxPython-src-2.5.3.1/bld# ./.make install Step7 Check that wxWidgets built correctly address@hidden:/usr/src/wxPython-src-2.5.3.1/bld# cd /opt/wx/2.5-3-1(these should now exist) Step8 Build the wxPython stuff First add stuff to some PATH's address@hidden:/usr/src/wxPython-src-2.5.3.1/bld# export PATH=$PATH:/opt/wx/2.5-3-1/bin address@hidden:/usr/src/wxPython-src-2.5.3.1/bld# export LD_LIBRARY_PATH=/opt/wx/2.5-3-1/lib address@hidden:/usr/src/wxPython-src-2.5.3.1/bld# cd $WXDIR/wxPython You should now be in for example: address@hidden:/usr/src/wxPython-src-2.5.3.1/wxPython# NB: ******************************************************************************************************** With this last step, if you don't include the WX_CONFIG and an earlier version of wxPython exists on your machine the wrong wx-config file will be found and the build will fail. All this text is on the one line in the terminal ********************************************************************************************************* root@ etc etc# python2.3 setup.py build_ext --inplace --debug WX_CONFIG=/opt/wx/2.5-3-1/bin/wx-config UNICODE=1 This build will take a while Step9: Using your new wxPython You can use either your old version of new version by changing the path variables. To test (or later use) the latest version, as user type the following in a terminal: address@hidden:~$ export PATH=$PATH:/opt/wx/2.5-3-1/bin address@hidden:~$ export LD_LIBRARY_PATH=/opt/wx/2.5-3-1/lib address@hidden:~$ export WXDIR=/usr/src/wxPython-src-2.5.3.1/ address@hidden:~$ export PYTHONPATH=$WXDIR/wxPython address@hidden:~$ cd $WXDIR/wxPython/demo address@hidden:~$ python2.3 demo.py Alternatively, and easier, save the lines between === as a file call .setup2531 ===================================== #!/bin/bash export PATH=$PATH:/opt/wx/2.5-3-1/bin export LD_LIBRARY_PATH=/opt/wx/2.5-3-1/lib export WXDIR=/usr/src/wxPython-src-2.5.3.1/ export PYTHONPATH=$WXDIR/wxPython export PYTHONPATH=$PYTHONPATH:$WXDIR/wxPython/demo export PYTHONPATH=$PYTHONPATH:$WXDIR/wxPython/wx export PYTHONPATH=$PYTHONPATH:$WXDIR/wxPython/wx/tools ===================================== address@hidden:~$ chmod +x .setup2531 (?can't remember if I did this as root then a chown richard.users setup2351) Then in a terminal type . .2351 (ie a fullstop space .2531) and this will set up the environment for wxPython 2.5-3-1 in that terminal. You should probably put a copy of this file to where you want to work with 2.5 and run it from there. Step10 Enjoy ADDENDUM: I have typed this in from memory - please try and inform me of errors Also those more knowledgable than myself feel free to correct and re-post this to the lsit. Richard Terry Gnumed Project www.gnumed.org address@hidden ACKNOWLEDGMENTS: To whoever wrote http://www.wxpython.org/BUILD.html To the wxPython users list for encouragement To Robin Dunn for (wxPython) and pointers re python-dev dependencies