Installation

Source Code Installation

Build Prerequisites

Recommended build prerequisites for PyQwt-5.2.1 are:

  1. Python, version 3.1.x, 2.7.x, 2.6.x, and 2.5.x are supported.
  2. Qt, version 4.6.x, 4.5.x, 4.4.x, and 3.3.x are supported.
  3. SIP, version 4.10.x is supported.
  4. PyQt for Mac OS X, Windows, and/or X11, version 4.7.x, and 3.18.x are supported.
  5. optionally NumPy, version 1.4.x, 1.3.x, and 1.2.x are supported. You will need to check out NumPy from subversion when you want to use NumPy with Python-3.x.
  6. optionally Qwt, version 5.2.x, 5.1.x, and 5.0.x are supported.

The source package PyQwt-5.2.1.tar.gz contains a snapshot of the Qwt-5.2 subversion bug fix branch which may fix some bugs in Qwt-5.2.1. I recommend to compile and link the bug fix branch statically into PyQwt.

To exploit the full power of PyQwt, you should install at least one of the numerical Python extensions:

and built PyQwt with support for the numerical Python extension(s) of your choice. However, only NumPy is actively developed and numarray and Numeric are deprecated.

PyQwt-5.2.1 and recent versions of the numerical Python extensions support the N-D array interface protocol. Therefore, PyQwt supports those extensions, even if they have not been installed when PyQwt has been built. In this case, the functionality is somewhat reduced, since conversion from an QImage to a Numerical Python array is not supported.

Installation

The installation procedure consists of three steps:

  1. Unpack PyQwt-5.2.1.tar.gz.

  2. Invoke the following commands to build PyQwt-5.2.1 for Qt-4:

    cd PyQwt-5.2.1
    cd configure
    python configure.py -Q ../qwt-5.2
    make
    make install

    or invoke the commands to build PyQwt-5.2.1 for Qt-3:

    cd PyQwt-5.2.1
    cd configure
    python configure.py -3 -Q ../qwt-5.2
    make
    make install

    This assumes that the correct Python interpreter is on your path. Replace make by nmake, if you use Microsoft Visual C++. The commands build PyQwt against the included Qwt subversion snapshot and install PyQwt. Test the installation by playing with the example programs.

  3. Fine tune (optional):

    • to use a Qwt library already installed on your system invoke commands similar to:

      python configure.py -I/usr/include/qwt -lqwt
      make
      make install

      where the Qwt header files are assumed to be installed in /usr/include/qwt.

      If the linker fails to find the qwt library, add:

      -L /directory/with/qwt/library

      to the configure.py options.

    The configure.py script takes many options. The command:

    python configure.py -h

    displays a full list of the available options

    Usage: python configure.py [options]
    
    Each option takes at most one argument, but some options
    accumulate arguments when repeated. For example, invoke:
    
    	python configure.py -I . -I ..
    
    to search the current *and* parent directories for headers.
    
    Options:
      -h, --help            show this help message and exit
    
      Common options:
        -3, --qt3           build for Qt3 and PyQt [default Qt4]
        -4, --qt4           build for Qt4 and PyQt4 [default Qt4]
        -Q /sources/of/qwt, --qwt-sources=/sources/of/qwt
                            compile and link the Qwt source files in
                            /sources/of/qwt statically into PyQwt
        -I /usr/lib/qt3/include/qwt, --extra-include-dirs=/usr/lib/qt3/include/qwt
                            add an extra directory to search for headers (the
                            compiler must be able to find the Qwt headers without
                            the -Q option)
        -L /usr/lib/qt3/lib, --extra-lib-dirs=/usr/lib/qt3/lib
                            add an extra directory to search for libraries (the
                            linker must be able to find the Qwt library without
                            the -Q option)
        -j N, --jobs=N      concatenate the SIP generated code into N files
                            [default 1 per class] (to speed up make by running
                            simultaneous jobs on multiprocessor systems)
    
      Make options:
        --debug             enable debugging symbols [default disabled]
        --extra-cflags=EXTRA_CFLAG
                            add an extra C compiler flag
        --extra-cxxflags=EXTRA_CXXFLAG
                            add an extra C++ compiler flag
        -D HAS_EXTRA_SENSORY_PERCEPTION, --extra-defines=HAS_EXTRA_SENSORY_PERCEPTION
                            add an extra preprocessor definition
        -l extra_sensory_perception, --extra-libs=extra_sensory_perception
                            add an extra library
        --extra-lflags=EXTRA_LFLAG
                            add an extra linker flag
    
      SIP options:
        -x EXTRA_SENSORY_PERCEPTION, --excluded-features=EXTRA_SENSORY_PERCEPTION
                            add a feature for SIP to exclude (normally one of the
                            features in sip/features.sip)
        -t EXTRA_SENSORY_PERCEPTION, --timelines=EXTRA_SENSORY_PERCEPTION
                            add a timeline option for SIP (normally one of the
                            timeline options in sip/timelines.sip)
        --sip-include-dirs=SIP_INCLUDE_DIR
                            add an extra directory for SIP to search
        --trace             enable trace of the execution of the bindings [default
                            disabled]
    
      Detection options:
        --disable-numarray  disable detection and use of numarray [default
                            enabled]
        --disable-numeric   disable detection and use of Numeric [default enabled]
        --disable-numpy     disable detection and use of NumPy [default enabled]
    
      Install options:
        --module-install-path=MODULE_INSTALL_PATH
                            specify the install directory for the Python modules
    

Troubleshooting and getting help

  1. Check whether all development packages have been installed when make produces lots of errors on Linux.

  2. If you fail to install PyQwt, unpack PyQwt-5.2.1.tar.gz into a clean directory and create two log files containing stdout and stderr:

    python configure.py --your --options 2&>1 >configure.log
    make 2&>1 >make.log

    Send the log files to the mailing list after subscribing to the mailing list, because the mailing list is for subscribers only, see Getting help.

Table Of Contents

Previous topic

Introduction

Next topic

PyQwt Reference Guide

This Page