Skip to content

Installation Instructions

We recommend using the Stable Release versions if you are just looking to use the package directly. If you are seeking to develop the package further then follow the Development Environment instructions for installation.

Python: 3.10–3.12 recommended

Stable Release v3.0.0

The Stable Release version is recommended for users who want to use CARES Reinforcement Learning as a package without modifying the core codebase. It provides a tested, reliable version suitable for running experiments and applications.

1. Clone the latest Release (stable)

Clone the latest stable release of CARES Reinforcement Learning.

git clone --branch v3.0.0 https://github.com/UoA-CARES/cares_reinforcement_learning.git

Unstable Main Branch

Clone the main branch for the latest features - note this branch may not be stable as it is the working branch.

2. Install the Package

Install the package and it's dependencies through pip.

cd cares_reinforcement_learning
pip install -e .[gym]

Editable Install

This installs the package in editable mode (-e), allowing local changes to the code to be reflected without reinstalling.

Optional dependencies

The [gym] extra installs common environment dependencies.

Additional environment packages (e.g. robotics, vision, or MARL environments) may require installing extra dependencies separately.

Development Environment (UV/pyenv)

We recommend using pyenv to manage Python versions and uv to manage dependencies and work with reproducible environments from papers. This is because we have various other gym packages that can be installed and used and the general pyenv environment is useful to manage them together. This setup should be used by those looking to contribute to the code base or various gym packages.

1. Install uv and pyenv

Install uv using the official installer:

curl -Ls https://astral.sh/uv/install.sh | sh

Reproducible environments

Using uv ensures that dependency versions match those used in experiments and published results.

This is recommended when reproducing research or running benchmark comparisons.

Install 'pyenv' using the official installer:

curl -fsSL https://pyenv.run | bash

pyenv setup

After installing pyenv, ensure it is correctly added to your shell.

You may need to restart your terminal or run:

exec $SHELL

before pyenv commands are available.

2. Setup Virtual Environment (pyenv)

Install the required Python version - note you can use 3.12 if you prefer.

pyenv install 3.10
pyenv virtualenv 3.10 cares_rl_310
pyenv activate cares_rl_310

2. Clone the Main branch (unstable)

Clone the latest main of CARES Reinforcement Learning.

git clone https://github.com/UoA-CARES/cares_reinforcement_learning.git

3. Install Requirements (UV)

Install the project and its requirements - note we are using the --active command to work inside of the pyenv environment.

cd cares_reinforcement_learning
uv sync --active --extra gym

uv environment usage

The --active flag installs dependencies into the currently active environment.

Ensure your pyenv environment is activated before running uv sync.

Installation methods

Use either the pip install -e .[gym] method or the uv sync method.

Do not mix both approaches in the same environment, as this can lead to dependency conflicts.

Verify Installation

After installation, verify that the CLI is available:

cares-rl -h

You should see the help description below if all things are installed correctly.

usage: <command> [<args>]

positional arguments:
  {train,evaluate,test,resume}
                        Commands to run this package

options:
  -h, --help            show this help message and exit