talira

Gymnasium

The standard Python API for single-agent reinforcement learning environments, formerly OpenAI Gym

open sourceMITfree

Gymnasium is an open source Python library for developing and comparing reinforcement learning algorithms: a standard API between learning algorithms and environments, and a standard set of environments that follow it. It's a fork of OpenAI's Gym by its maintainers, after OpenAI handed maintenance to an outside team, and is where Gym's future maintenance happens. Environments are Python env classes created with gym.make, and it ships families of reference environments: Classic Control, Box2D, Toy Text, MuJoCo and Atari, plus many third-party environments that follow the API. Environments written for older Gym versions run through the Shimmy compatibility layer. It's maintained by the Farama Foundation, which also makes PettingZoo for multi-agent environments.

Problems it solves

  • a standard set of environments to benchmark my reinforcement learning algorithm
  • the maintained replacement for OpenAI Gym
  • train an agent on CartPole or MuJoCo tasks in Python

Features

  • a standard API between reinforcement learning algorithms and environments
  • Classic Control, Box2D, Toy Text, MuJoCo and Atari reference environments
  • runs older Gym environments through Shimmy
  • optional dependency groups per environment family

Limitations

  • The base install leaves out each environment family's dependencies, some of which can be hard to install on certain systems.1

Alternatives

The same job

These do what Gymnasium does.

  1. PettingZoo Python library of multi-agent reinforcement learning environments with a standard API, the multi-agent counterpart of Gymnasium.
  2. Stable Baselines3 Reliable reinforcement learning algorithms in PyTorch
  3. Agent Lightning Microsoft's lightweight reinforcement learning framework for training LLM agents inside their real harnesses
  4. MuJoCo Fast physics engine for robotics, biomechanics and reinforcement learning research, with a C API and Python bindings

Compare Gymnasium with the top 3