Installing pysteps

Dependencies

The pysteps package needs the following dependencies

Additionally, the following packages can be installed for better computational efficiency:

  • dask and toolz (for code parallelization)
  • pyfftw (for faster FFT computation)

Other optional dependencies include:

  • cartopy or basemap (for geo-referenced visualization)
  • h5py (for importing HDF5 data)
  • pywavelets (for intensity-scale verification)
  • cython (for compiling the variational echo tracking method)

Note that cython also requires a C compiler. See https://cython.readthedocs.io/en/latest/src/quickstart/install.html for instructions.

Install from source

IMPORTANT: installing from source requires numpy to be installed.

OSX users

pySTEPS uses Cython extensions that need to be compiled with multi-threading support enabled. The default Apple Clang compiler does not support OpenMP, so using the default compiler would have disabled multi-threading and you will get the following error during the installation:

clang: error: unsupported option '-fopenmp'
error: command 'gcc' failed with exit status 1

To solve this issue, obtain the lastest gcc version with Homebrew that has multi-threading enabled:

brew install gcc

To make sure that the installer uses the homebrew’s gcc, export the following environmental variables in the terminal (supposing that gcc version 8 was installed):

export CC=gcc-8
export CXX=g++-8

First, check that the homebrew’s gcc is detected:

which gcc-8

This should point to the homebrew’s gcc installation.

Under certain circumstances, Homebrew does not add the symbolic links for the gcc executables under /usr/local/bin. If that is the case, specify the CC and CCX variables using the full path to the homebrew installation. For example:

export CC=/usr/local/Cellar/gcc/8.3.0/bin/gcc-8
export CXX=/usr/local/Cellar/gcc/8.3.0/bin/g++-8

Then, you can continue with the normal installation procedure described next.

Installation

The installer needs numpy to compile the Cython extensions. If numpy is not installed you can install it by running in a terminal:

pip install numpy

The latest pysteps version in the repository can be installed using pip by simply running in a terminal:

pip install git+https://github.com/pySTEPS/pysteps

Or, to install it using setup.py run (global installation):

git clone https://github.com/pySTEPS/pysteps
cd pysteps
python setup.py install

For user installation:

python setup.py install --user

If you want to install the package in a specific directory run:

python setup.py install --prefix=/path/to/local/dir

Troubleshooting

The installation using setup.py will try to to install the minimum dependencies needed to run the program correctly. If you are not using the recommended conda environment (defined in environment.yml) or you are working with a minimal python distribution, you may get the following error during the installation:

ModuleNotFoundError: No module named 'Cython'

This means that Cython is not installed, which is needed to build some of the dependencies of pySTEPS.

For non-anaconda users, you can install Cython using:

pip install Cython

Anaconda users can install Cython using:

conda install cython

Setting up the user-defined configuration file

The pysteps package allows the users to customize the default settings and configuration. The configuration parameters used by default are loaded from a user-defined JSON file and then stored in the pysteps.rcparams AttrDict.