- 1 How to install pyWPS
- 1.1 Prerequirements
- 1.2 Recommended packages
- 1.3 Installation the quick ‘n’ dirty way
- 1.4 Installation the "clean" way
- 1.5 Installation the "fresh" way
- 1.6 Installation the "desesperado" way
- 1.7 Template Error
- 1.8 Installation using prebuilt distribution packages
- 1.9 Installation from script
- 1.10 Testing installation
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-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
PyWPS 3.2 SOAP
The following packages are necessary for the branch version 3.2-SOAP
- python-magic (5.04)
- Web Server
(e.g. Apache) http://httpd.apache.org - 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 http://www.lighttpd.net/) 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
http://grass.itc.it - 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.
http://proj.maptools.org - 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.
http://gdal.org - 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.
http://mapserver.org - 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.
http://www.r-project.org and http://rpy.sourceforge.net/rpy2.html - 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).
http://postgis.refractions.net/ - 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
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 setup.py install
Installation the "fresh" way
1- Get the master branch from GitHub
git clone git://github.com/geopython/PyWPS.git
2- cd to the directoty
$ cd ./PyWPS
3- Run the setup.py script
$ python setup.py 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 setup.py install --dry-run
PyWPS requires that the template structure is compiled before use. If setup.py is unable to compile them, the following XML will appear in response to a GetCapabilities request:
<ows:ExceptionReport version="1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd"> <ows:Exception exceptionCode="NoApplicableCode"> <ows:ExceptionText> '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",)' </ows:ExceptionText> </ows:Exception> </ows:ExceptionReport>
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 http://pywps.wald.intevation.org/download/index.html
Installation from script
Rumors....it's just rumors.....
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 wps.py 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 setup.py)
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="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Exception exceptionCode="NoApplicableCode"> <ExceptionText> No query string found. </ExceptionText> </Exception> </ExceptionReport>
In this case, you have installed PyWPS correctly and you are ready to proceed to configuration.
--Wikiadmin 15:34, 10 January 2011 (UTC)