Skip to content

Installation

Salvador Navas edited this page Jul 2, 2026 · 1 revision

Installation

Requirements

  • Python 3.9 or newer.
  • pip or another PEP 517-compatible installer.
  • Internet access when installing from GitHub or downloading pilot-case data.
  • Optional: Docker Desktop or Docker Engine for the notebook environment.

Some modules require additional external tools or credentials:

  • CDS API credentials for Copernicus/ERA5/GloFAS workflows.
  • NASA Earthdata credentials for some GPM workflows.
  • AEMET OpenData API key for AEMET downloads.
  • Local HEC-HMS, HEC-RAS, SWAT+ or SFINCS installations for model execution.
  • Optional geospatial libraries such as GDAL for raster-heavy workflows.

Install From GitHub

pip install git+https://github.com/navass11/pyhydra.git

Development Install

git clone https://github.com/navass11/pyhydra.git
cd pyhydra
python -m venv .venv
source .venv/bin/activate
pip install -e .

Install pytest when developing:

pip install pytest
pytest tests/

Optional Geospatial Dependencies

pip install "pyhydra[geo] @ git+https://github.com/navass11/pyhydra.git"

GDAL installations are platform-sensitive. If a local installation fails, use a Conda environment or the Docker notebook environment.

Optional Stochastic Dependencies

Point and spatial stochastic generation can use optional libraries that are not part of the minimal dependency set:

  • NEOPRENE for NSRP and STNSRP precipitation models.
  • CoSMoS_py for CoSMoS-based time-series and spatial-field generation.

Install them only for workflows that require them. The package raises explicit import errors when those optional dependencies are missing.

Verify Installation

python - <<'PY'
import pyhydra
print(pyhydra.__version__)
PY

Data Workspace

Large datasets, model projects and downloaded pilot-case files should not be committed to Git. Use a local data workspace:

export HYDRA_DATA_DIR=/path/to/data
pyhydra-get-data

If HYDRA_DATA_DIR is not defined, data helpers default to ./data relative to the current working directory.

Clone this wiki locally