Skip to main content

Installation

KoopmanRL requires Python 3.10. There are two recommended installation paths.

uv manages the full project environment from the lock file, guaranteeing exact reproducibility.

# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone and sync
git clone https://github.com/dynamicslab/KoopmanRL.git
cd KoopmanRL
uv sync

All scripts are then run with the uv run prefix:

uv run -m koopmanrl.soft_koopman_value_iteration

Option 2 — Virtual environment + pip​

git clone https://github.com/dynamicslab/KoopmanRL.git
cd KoopmanRL

python3.10 -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate

pip install .

After activating the environment, scripts are run directly:

python -m koopmanrl.soft_koopman_value_iteration

Development install​

To install with development dependencies (testing, linting):

# uv
uv sync --group dev

# pip (>= 25.1; `dev` is a PEP 735 dependency group, not an extra)
pip install --group dev .

# older pip
pip install . pre-commit pytest pytest-cov

Verifying the installation​

uv run python -c "import koopmanrl; print('KoopmanRL installed successfully')"

Or run the test suite:

uv run pytest

Dependencies​

PackagePurpose
torch >= 2.9.1Neural network training
gym == 0.23.1RL environment interface
cleanrl >= 1.2CleanRL RL algorithm implementations
control >= 0.10.2Linear control theory utilities
optuna >= 3.0Hyperparameter optimisation
ray[tune] >= 2.53Distributed hyperparameter search
scipy >= 1.15.3Scientific computing
stable-baselines3 == 1.2.0Replay buffer for the SAC-style algorithms
tensorboard >= 2.20Experiment logging
numpy >= 2.2.6Numerical arrays
matplotlib >= 3.10.8Plotting
typed-argument-parser >= 1.11Typed command-line parsers (tap) of all scripts
scikit-learn >= 1.6t-SNE embedding and regressor comparison utilities
rliable >= 1.2IQM and stratified bootstrap confidence intervals for result processing