Skip to content

Installation

Bich N Tran edited this page Mar 26, 2021 · 1 revision

The scripts to download and process the WaPOR data for land and water productivity assessment are developed in the python programming language. The scripts can be downloaded from the water accounting repository on GitHub and run in Jupyter Notebook. Beginners of python programming are advised to follow the OCW of IHE Delft on python scripting before starting with implementing the provided scripts . A beginning programmer should be able to run the scripts, it is advised to run them using Jupyter notebook. The following sections describe the installation requirements.

1. Running from Jupyter notebook

The requirement of the python and libraries used in the protocol

  • python 3.7.3
  • numpy 1.16.4
  • pandas 0.24.2
  • GDAL 2.3.3
  • pyshp 2.1.0

2. Install python, Jupyter notebook and libraries (packages)

i) Install python and jupyter notebook using the Anaconda distribution: https://www.anaconda.com/products/individual

Use the anaconda installer, which is tailored to different operating system: window (64-Bit and 32-Bit), MacOS (64-Bit) or Linux system.

Read more on Jupyter notebook: https://jupyter.org/, https://packaging.python.org/overview/ Steps to run Jupyter notebook refer from https://github.com/wateraccounting/WAPOROCW/blob/master/README.md

ii) Install packages:

Packages such as GDAL, pyshp can be installed using pip or conda.

a) Pip is the Python Packaging Authority’s recommended tool for installing packages from the Python Package Index (PyPI), which is a repository of software for the Python programming language (https://pypi.org/). Pip installs python packages in any environment. Type the following codes to Install a pip package in the current Jupyter kernel:
import sys
!{sys.executable} -m pip install 'package'

b) Conda is a cross platform package and environment manager that installs and manages conda packages from the Anaconda repository (https://repo.anaconda.com/) and the Anaconda Cloud (https://anaconda.org/). Conda installs any package in conda environments. Type the following codes to Install a conda package in the current Jupyter kernel:
import sys
!conda install --yes --prefix {sys.prefix} 'package' More tutorials on conda commands: https://docs.conda.io/projects/conda/en/latest/user-guide/index.html
Example: screen shot of installing gdal package title