Skip to content

Installation

Prerequisites

  • Python 3.8-3.9 (not yet 3.10)
  • Poetry

Simply run the following command for a quick start

git clone https://github.com/vwxyzjn/cleanrl.git && cd cleanrl
poetry install

Working with PyPI mirrors

Users in some countries (e.g., China) can usually speed up package installation via faster PyPI mirrors. If this helps you, try appending the following lines to the pyproject.toml at the root of this repository and run poetry install

[[tool.poetry.source]]
name = "douban"
url = "https://pypi.doubanio.com/simple/"
default = true

Optional Dependencies

CleanRL makes it easy to install optional dependencies for common RL environments and various development utilities. These optional dependencies are defined at pyproject.toml as shown below:

atari = ["ale-py", "AutoROM", "stable-baselines3"]
pybullet = ["pybullet"]
procgen = ["procgen", "stable-baselines3"]
pettingzoo = ["pettingzoo", "stable-baselines3", "pygame", "pymunk"]
plot = ["pandas", "seaborn"]
cloud = ["boto3", "awscli"]
docs = ["mkdocs-material"]
spyder = ["spyder"]

You can install them using the following command

poetry install -E atari
poetry install -E pybullet
poetry install -E mujoco
poetry install -E procgen
poetry install -E envpool
poetry install -E pettingzoo

Install via pip

While we recommend using poetry to manage environments and dependencies, the traditional requirements.txt are available:

pip install -r requirements/requirements.txt
pip install -r requirements/requirements-atari.txt
pip install -r requirements/requirements-pybullet.txt
pip install -r requirements/requirements-mujoco.txt
pip install -r requirements/requirements-procgen.txt
pip install -r requirements/requirements-envpool.txt
pip install -r requirements/requirements-pettingzoo.txt