1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
.. _installation:
Installation
============
.. note:: PyWPS is not tested on the Microsoft Windows platform. Please join the development team
if you need this platform to be supported. This is mainly because of the lack of a multiprocessing
library. It is used to process asynchronous execution, i.e., when making requests storing the response
document and updating a status document displaying the progress of execution.
Dependencies and requirements
-----------------------------
PyWPS runs on Python 3.7 or higher. PyWPS is currently tested and developed on Linux (mostly Ubuntu).
In the documentation we take this distribution as reference.
Prior to installing PyWPS, Git and the Python bindings for GDAL must be
installed in the system. On Debian based systems, these packages can be
installed with a tool like *apt*::
$ sudo apt-get install git python-gdal
Alternatively, if GDAL is already installed on your system you can install the GDAL Python bindings via pip with::
# Determine version of GDAL installed on your system
$ export GDAL_VERSION="$(gdal-config --version)"
# Install GDAL Python bindings
$ pip install gdal==$GDAL_VERSION --global-option=build_ext --global-option="-I/usr/include/gdal"
.. Warning::
If you are using setuptools 63.0 or higher, you need to install the
GDAL Python bindings with the following command::
# Determine version of GDAL installed on your system
$ export GDAL_VERSION="$(gdal-config --version)"
# Install GDAL Python bindings
$ pip install --upgrade --force-reinstall --no-cache-dir gdal==$GDAL_VERSION --no-binary gdal
Download and install
--------------------
Using pip
The easiest way to install PyWPS is using the Python Package Index
(PIP). It fetches the source code from the repository and installs it
automatically in the system. This might require superuser permissions
(e.g. *sudo* in Debian based systems)::
$ sudo pip install -e git+https://github.com/geopython/pywps.git@main#egg=pywps
.. todo::
* document Debian / Ubuntu package support
Manual installation
Manual installation of PyWPS requires `downloading <https://pywps.org/download>`_ the
source code followed by usage of the `setup.py` script. An example again for Debian based systems (note
the usage of `sudo` for install)::
$ tar zxf pywps-x.y.z.tar.gz
$ cd pywps-x.y.z/
Then install the package dependencies using pip::
$ pip install -r requirements.txt
$ pip install -r requirements-gdal.txt # for GDAL Python bindings (if python-gdal is not already installed by `apt-get`)
$ pip install -r requirements-dev.txt # for developer tasks
To install PyWPS system-wide run::
$ sudo pip install .
For Developers
Installation of the source code using Git and Python's virtualenv tool::
$ virtualenv my-pywps-env
$ cd my-pywps-env
$ source bin/activate
$ git clone https://github.com/geopython/pywps.git
$ cd pywps
Then install the package dependencies using pip as described in the Manual installation section. To install
PyWPS::
$ pip install .
Note that installing PyWPS via a virtualenv environment keeps the installation of PyWPS and its
dependencies isolated to the virtual environment and does not affect other parts of the system. This
installation option is handy for development and / or users who may not have system-wide administration
privileges.
.. _flask:
The Flask service and its sample processes
------------------------------------------
To use PyWPS the user must code processes and publish them through a service.
An example service is available that makes up a good starting point for first time
users. It launches a very simple built-in server (relying on the `Flask Python
Microframework <http://flask.pocoo.org/>`_), which is good enough for testing but probably not
appropriate for production. This example service can be cloned directly into the user
area::
$ git clone https://github.com/geopython/pywps-flask.git
It may be run right away through the `demo.py` script. First time users should
start by studying the structure of this project and then code their own processes.
There is also an example service
Full more details please consult the :ref:`process` section. The example service
contains some basic processes too, so you could get started with some examples
(like `area`, `buffer`, `feature_count` and `grassbuffer`). These processes are
to be taken just as inspiration and code documentation - most of them do not
make any sense (e.g. `sayhello`).
|