SourceForge.net Logo
PythonQt
Building

PythonQt requires at least Qt 4.6.1 (for earlier Qt versions, you will need to run the pythonqt_gerenator, Qt 4.3 is the absolute minimum) and Python 2.5.x or 2.6.x on Windows, Linux and MacOS X. It has not yet been tested with Python 3.x, but it should only require minor changes. To compile PythonQt, you will need a python developer installation which includes Python's header files and the python2x.[lib | dll | so | dynlib]. The build scripts a currently set to use Python 2.6. You may need to tweak the build/python.prf file to set the correct Python includes and libs on your system.

Note:
In addition to the qmake profiles, PythonQt now offers building via Cmake. Just use the provided CMakeLists.txt in the root directory of the project. This build option has not been well tested yet.

Windows

On Windows, the (non-source) Python Windows installer can be used. Make sure that you use the same compiler, the current Python distribution is built with Visual Studio 2003. If you want to use another compiler, you will need to build Python yourself, using your compiler.

To build PythonQt, you need to set the environment variable PYTHON_PATH to point to the root dir of the python installation and PYTHON_LIB to point to the directory where the python lib file is located.

When using the prebuild Python installer, this will be:

 > set PYTHON_PATH = c:\Python26
 > set PYTHON_LIB  = c:\Python26\libs

When using the python sources, this will be something like:

  > set PYTHON_PATH = c:\yourDir\Python-2.6.1\
  > set PYTHON_LIB  = c:\yourDir\Python-2.6.1\PCbuild8\Win32

To build all, do the following (after setting the above variables):

 > cd PythonQtRoot
 > vcvars32
 > qmake
 > nmake

This should build everything. If Python can not be linked or include files can not be found, you probably need to tweak build/python.prf

The tests and examples are located in PythonQt/lib.

Linux

On Linux, you need to install a Python-dev package. If Python can not be linked or include files can not be found, you probably need to tweak build/python.prf

To build PythonQt, just do a:

 > cd PythonQtRoot
 > qmake
 > make all

The tests and examples are located in PythonQt/lib. You should add PythonQt/lib to your LD_LIBRARY_PATH so that the runtime linker can find the *.so files.

MacOSX

On Mac, Python is installed as a Framework, so you should not need to install it. To build PythonQt, just do a:

 > cd PythonQtRoot
 > qmake
 > make all

Tests

There is a unit test that tests most features of PythonQt, see the tests subdirectory for details.