From PyWPS
Jump to: navigation, search

How to install pyWPS

It is assumed that the user is familiar with standard Linux package installation, how to search and fetch package and with basic bash knowledge


  • python – currently 2.5, 2.6 are supported, 2.4 is deprecated
  • python-setuptools
  • python-xml (in more recent Debian based distributions this may not be needed)

Note: The htmltmpl engine is no longer necessary in the latest pyWPS version


The following packages are necessary for the branch version 3.2-SOAP

  • python-magic (5.04)
  • python-lxml

Recommended packages

  • Web Server

(e.g. Apache) - You will need a web server, to be able to execute processes from remote computers. PyWPS was tested with Apache 1.1 and 2.x versions. Other web servers that support python as CGI script (e.g. LightHTTPD should be able to run pyWPS but it was never tested.

In the current SVN version (August 2010), it is also possible to use TomCat webserver, in this case with the help of Jython.

  • GIS GRASS - Geographical Resources Analysis Support System (GRASS) is Open Source GIS, which provides more then 350 modules for raster and vector (2D, 3D) data analysis. PyWPS is written with native support for GRASS and it’s functions. GRASS has also Python bindings, so you can run the modules directly.

  • PROJ.4 - Cartographic Projections library used in various Open Source projects, such as GRASS, UMN MapServer, QGIS and others. It can be used e.g. for data transformation. Proj4 is especially needed, if you want to integrate MapServer as well, in that case, you need python-pyproj package.

  • GDAL/OGR - translator library for raster geospatial data formats, is used in various projects for importing, exporting and transformation between various raster and vector data formats. GDAL and OGR are also needed, if you want to integrate MapServer as well. In that case, you need python-gdal package.

  • MapServer - If you want to access ComplexValue outputs using OGC OWS (WMS, WFS, WCS) services, you have to install MapServer as well. PyWPS will generate MapFile for you automaticaly. Look after python-mapscript package.

  • R and - is a language and environment for statistical computing and graphics. To use an R session from the execute method it is recommend to install R and then the python package (rpy2).

  • PostGIS - It you want to use a spatial database then PostGIS is the natural option.

The packages here presented are just recommendations (though the Web server will be needed for most applications); they don't need to be installed for pyWPS to work, but they are powerful tools to use in any GeoScript.

Installation the quick ‘n’ dirty way

For installing PyWPS to your server simply unpack the archive to some directory. You can also use current repository version.:

1- copy the pyWPS package to the desired location (in this case /usr/local)

cp pywps-VERSION.tar.gz /usr/local

2- cd to target directory:

$ cd /usr/local/

3 - unpack pywps:

$ tar -xvzf /tmp/pywps-VERSION.tar.gz

4 - You have to change the write access of pywps/Templates/WPS_VERSION/ directory, so the web server can compile the templates:

$ chmod 777 /usr/local/pywps-VERSION/pywps/Templates/1_0_0

5 - pyWPS will run from the /usr/local directory and it may be necessary to set the path in the bash

$ export PATH=/usr/local/pywps-VERSION:$PATH

6- Also it is advisable to include the pyWPS location to the PYTHONPATH

$export PYTHONPATH=/usr/local/pywps-VERSION:$PYTHONPATH

Installation the "clean" way

1- Unpack the package (to some temporary folder)

tar -xvzf /tmp/pywps-VERSION.tar.gz

2 - From inside the folder run:

$ python install

Installation the "fresh" way

1- Get the master branch from GitHub

git clone git://

2- cd to the directoty

$ cd ./PyWPS

3- Run the script

$ python install

Note: you might need root priveliges to run the setup; in Debian family distributions use sudo.

Installation the "desesperado" way

During installation, in some linux distributions, an error may raise relative to the installation path of Templates/ in the case it's advisable to install using the dry-run flag. This will skip the template compilation step

$python install --dry-run

Template Error

PyWPS requires that the template structure is compiled before use. If is unable to compile them, the following XML will appear in response to a GetCapabilities request:

<ows:ExceptionReport version="1.0.0" xmlns:ows="" 
	<ows:Exception exceptionCode="NoApplicableCode">
			'TemplateError: TemplateError("Could not store file in compiled form: 
[Errno 13] Permission denied: \'/usr/local/lib/python2.6/dist-packages/pywps/Templates/1_0_0/GetCapabilities.tmplc\'. 
Try to set permission for this directory to 777",)'

The solution is to give execute permission to /usr/local/lib/python2.6/dist-packages/pywps/Templates at least for the first time that pywps is requested. After compilation the Templates/ will no longer be changed

Installation using prebuilt distribution packages

PyWPS provides packages for DEB and RPM-based Linux Distributions. The packages are not maintained properly, and until we find maintainers, we recommend to use any other approach described earlier in this section. If you decide to use a package please use the following link

Installation from script's just rumors.....

Testing installation

If PyWPS has been successfully installed, you can test this with running it without any input or further configuration.

First you need to find the script, which is in the root of pywps installation directory (if you used the Quick and dirty way), or it should be located in /usr/bin directory, if you used the clean way of installation (and you didn't passed any location path to

Anyway, you have to run it in command line:

$ ./

And you should get result like this (which is a mixture of standard output and standard error):

PyWPS NoApplicableCode: Locator: None; Value: No query string found.
Content-type: text/xml

<?xml version="1.0" encoding="utf-8"?>
<ExceptionReport version="1.0.0" xmlns="" xmlns:xsi="">
 <Exception exceptionCode="NoApplicableCode">
 No query string found.

In this case, you have installed PyWPS correctly and you are ready to proceed to configuration.

--Wikiadmin 15:34, 10 January 2011 (UTC)