Tutorial 01 - Installation Guide#

This tutorial walks through installing the Pywr-DRB package in a clean virtual environment. Installation supports both standard usage and developer workflows.

Step 1 - Set Up a Virtual Environment#

We recommend using a virtual environment to manage dependencies.

For Windows:

python -m venv venv
venv\Scripts\activate

For Mac/Linux:

python3 -m venv venv
source venv/bin/activate

Step 2 - Install Pywr-DRB#

Option B (Developer Mode): Clone and Install Editable Version#

To work directly with the source code:

git clone https://github.com/Pywr-DRB/Pywr-DRB.git
cd Pywr-DRB

Then install it in editable mode:

pip install -e .

This installs the package in editable mode, so local changes are immediately reflected without reinstallation.

Step 3 - Verify the installation#

Test the installation by importing the package in Python:

import pywrdrb

If no error is raised, the installation was successful.

Next Steps#

To get started, check out the example notebooks provided in the
Pywr-DRB GitHub repository under the notebooks/ folder.

These cover:

  • Running a simulation and viewing results

  • Setting up custom datasets and optimization workflows