Installation guide#

Prerequisites#

Python and conda/mamba#

You’ll need Python 3.9 or greater and a package manager such as conda or mamba. These package managers help you to install (Python) packages and manage environments such that different installations do not conflict.

We recommend using the Mambaforge Python distribution. This installs Python and the mamba package manager. Miniforge and Miniconda will install Python and the conda package manager. Differences to note, in a nutshell:

  • mamba is much faster than conda, but has identical commands.

  • Mambaforge and miniforge are community driven installers, installing by default from the conda-forge channel.

  • Miniconda is a company driven (Anaconda) installer, installing by default from the anaconda channel.

  • Installing from the anaconda channel has certain (legal) limitations for commercial use.

Installing Mambaforge/Miniforge/Miniconda does not require administrative rights to your computer and doesn’t interfere with any other Python installations in your system.

Dependencies#

The HydroMT Python package makes extensive use of the modern scientific Python ecosystem. The most important dependencies are listed here (for a complete list, see the pyproject.toml file in the repository root). These dependencies are automatically installed when installing HydroMT with a package manager, such as conda or mamba.

Data structures:

Delayed/out-of-core computation, parallelization:

Spatial and statistical operations:

(Hydro-)Geospatial libraries:

Command line interface

Installation#

HydroMT is available from pypi and conda-forge, but we recommend installing from conda-forge in a new conda environment.

Tip

In the commands below you can exchange conda for mamba, see above for the difference between both.

Note

If you would like to try out the hydromt examples notebook, follow instead the examples installation guide.

Install HydroMT in a new environment#

Tip

This is our recommended way of installing HydroMT!

To install HydroMT in a new environment called hydromt from the conda-forge channel do:

$ conda create -n hydromt -c conda-forge hydromt

Then, activate the environment (as stated by conda create) to start making use of HydroMT. To test whether the installation was successful you can run hydromt --models and the output should look approximately like the one below:

$ hydromt --models

model plugins:
generic models (hydromt 0.7.2):
 - grid_model
 - vector_model
 - mesh_model
 - network_model

Optionally, specific versions of python or other dependencies can be set and additional packages can be added, for example Python version 3.9 and GDAL 3.4.1 and the HydroMT-Wflow plugin:

$ conda create -n hydromt -c conda-forge hydromt python=3.9 gdal=3.4.1 hydromt_wflow

Install HydroMT in an existing environment#

To install HydroMT using mamba or conda execute the command below after activating the correct environment. Note that if some dependencies are not installed from conda-forge the installation may fail.

$ conda install hydromt -c conda-forge

You can also install HydroMT using pip from pypi (not recommended):

$ pip install hydromt

To install the latest (unreleased) version from github, execute the command below. Note that you might have to uninstall HydroMT first to successfully install from github.

$ pip install git+https://github.com/Deltares/hydromt.git

Install HydroMT plugins#

To use HydroMT to set up specific models, we separate plugins that are available as separate python packages. Most plugins are available on conda-forge and can be installed in the same environment. For instance, to install HydroMT-Wflow in the environment where you have already installed HydroMT do:

$ conda install hydromt_wflow -c conda-forge

For detailed instructions, please visit the plugin documentation pages, see overview of plugins.

Developer installation#

To be able to test and develop the HydroMT package see instructions in the Developer installation guide.