You can install PyQwt on Unix/Linux and Windows.
see the Section called Installation on Unix and Linux for installation instructions starting from source code for Unix and Linux.
see the Section called Binary Installation on Windows for instructions on the use of the binary Windows installer (only for Qt-2.3.0-NonCommercial).
see the Section called Source Installation on Windows for installation instructions starting from source code for Windows and MSVC (all versions of Qt-2.x.x).
Recent versions of the following software should be installed on your system:
Python. I am using version 2.1.1, but versions 2.1 and 2.0 are also known to work. Python-1.5.2 is no longer being supported.
NumPy. I am using version 20.2.1. Known problem: PyQwt does not build against Numeric-20.0.0. Upgrade to 20.1.0, 20.2.0 or 20.2.1.
Qt. I am using version 2.3.1 and 3.0.0, but any Qt-2.x.x may work. Qt-1.45 (and earlier) are incompatible PyQwt.
sip. I am using version 3.0. Support for sip-2.5 will be depreciated.
PyQt. I am using version 3.0. Support PyQt-2.5 will be depreciated.
Known problem: Do not mix EITHER sip-2.5 with PyQt-3.0 OR sip-3.0 with PyQt-2.5.
Known problem: Get the subversion of PyQt that corresponds with your version of Qt (expect mysterious crashes if you break this rule).
Edit the assignments to the variables qt_dir, sip_program, sip_incdir, sip_spec_dirs and library_dirs in the following fragment of the file setup.py:
else: qt_dir = '/usr/lib/qt3' sip_program = '/usr/bin/sip' sip_incdir = '/usr/include/sip' sip_spec_dirs = ['/usr/share/sip/qt'] #libraries = ['qtcmodule'] # for PyQt-2.5 libraries = ['qtcmodule', 'qttablecmodule'] # for PyQt-3.0 library_dirs = ['/usr/lib/python2.1/site-packages'] |
qt_dir must be set to the Qt directory containing the sub-directories bin, lib and include (installations of Qt with a non-standard directory layout are not yet supported by distutils).
sip_program must be set to the full path of the sip executable (if it is not in your path).
sip_incdir must be set to the directory containing the files sip.h and sipQt.h.
sip_spec_dirs must be set to a list with the name of the directory containing qt.sip & friends.
library_dirs must be set to a list with the name of the directory containing libqtcmodule*.so. If the directory containing libsip.so is not a standard directory for libraries, you must add the name of that directory to the list.
The command python setup.py build builds the PyQwt extension.
Play with the *.py files in the directories examples, network and pyuic. As you can see, adapting sys.path makes PyQwt operational without installation. Do you REALLY need to install?
If yes, be sure not to have files of different versions of PyQwt in your Python library directory tree. How do you uninstall older versions? The first time you may have to do this manually. But, there are better ways:
In case of a RPM based distribution, the command python setup.py bdist_rpm makes RPM packages in the sub-directory dist. I always uninstall an obsolete RPM package of PyQwt with the command rpm -e PyQwt before installing a new RPM package with a command like rpm -Uvh dist/PyQwt*.i686.rpm.
In other cases, the command python setup.py bdist_dumb makes a "dumb" built distribution -- i.e, just an archive to be unpacked under /. If you keep the archive, you you have a trace of the installed files. Debian users may be able to convert the archive to a Debian package with alien.
Debugging: setup.py checks if the values of the variables are reasonable and informs you in case of failure. If so, think, and edit setup.py again. If you are really desperate, create a log with the command ./setup.py build --force >log.txt, mail log.txt to me and I will try to help.
First, you have to install Python, NumPy, Qt-2.3.0-NC and PyQt by executing the following installation programs:
Python-2.1.1.exe
Numeric-20.2.0.win32-py2.1.exe
QtWin230-NonCommercial.exe
PyQt-2.5-Qt-NC.exe
Building PyQwt from source on Windows with Microsoft Visual C++ makes use of distutils. If you are using another compiler, contact me, and I will help you to adapt my distutils scripts.
I advise that you bring your Python and NumPy installation up to date by executing Python-2.1.1.exe and Numeric-20.2.0.win32-py2.1.exe, but other recent versions should also work.
Install a recent version of Qt, for instance: 2.3.1, 2.3.0, 2.3.0-NonCommercial or 2.2.x.
Unzip sip-2.5.zip into for instance C:\MyStuff and build sip and siplib.
Unzip the version of the PyQt source code that is compatible with your Qt-version into for instance C:\MyStuff and build PyQt.
Install a binary version of PyQt-2.5 that is compatible with your Qt-version.
Unzip PyQwt-0.29.94.zip into for instance C:\MyStuff.
Edit the assignments to the variables qt_dir, sip_program, sip_incdir, sip_spec_dirs and library_dirs in the following fragment of the file C:\MyStuff\PyQwt-0.29.94\setup.py:
if os.name == 'nt': # Windows-95, -98, NT? qt_dir = 'C:\qt' sip_program = 'C:\MyStuff\sip-2.5\sip\sip.exe' sip_incdir = 'C:\MyStuff\sip-2.5\siplib' sip_spec_dirs = ['C:\MyStuff\PyQt-2.5\sip'] library_dirs = ['C:\MyStuff\PyQt-2.5\qt', 'C:\MyStuff\sip-2.5\siplib'] else: |
qt_dir must be set to the value displayed by the command echo %QTDIR%.
sip_program must be set to the full path of sip.exe.
sip_incdir must be set to the directory containing the files sip.h and sipQt.h.
sip_spec_dirs must be set to a list with the name of the directory containing qt.sip & friends.
library_dirs must be set to a list with the names of the directories containing libqtc.lib and sip.lib respectively.
The command python setup.py bdist or python setup.py bdist_wininst should make a binary distribution in the sub-directory dist.
Debugging: setup.py checks if the values of the variables are reasonable and informs you in case of failure. If so, think, and edit setup.py again. If you are really desperate, create a log with the command python setup.py build --force >log.txt, mail log.txt to me and I will try to help.