Gymnasium defines a common env interface between RL algorithms and simulators, with bundled reference worlds and utilities. It continues maintenance of the former OpenAI Gym codebase under the Farama Foundation.
Overview
Gymnasium is a Python library that standardizes how reinforcement learning code talks to environments. Learning algorithms create env instances, reset for observations, step with actions, and read rewards, termination, and truncation flags through one shared pattern.
Shipped environment families include classic control, Box2D physics toys, toy text grids, MuJoCo control tasks, Atari ROM emulators, and hooks for third-party envs. Optional dependency groups install only the physics or Atari stacks you need; a meta package pulls every family when you want the full set.
The project keeps versioned environment IDs with suffixes like -v0 so benchmark results stay comparable when dynamics change. Shimmy extras help load older OpenAI Gym v0.21 or v0.26 environments through Gymnasium’s make API.
Documentation and community support live on the Farama site and Discord. Related Farama projects provide additional environments that follow the same API, so teams can swap simulators without rewriting training loops.
Key features
- Unified reset and step API
- Classic control environments
- Box2D and MuJoCo worlds
- Atari emulator tasks
- Strict environment versioning
- Gym compatibility via Shimmy
- Optional dependency bundles
Use cases
- Comparing RL algorithms fairly
- Teaching RL with small envs
- Benchmarking policy training
- Prototyping agents on Atari or control tasks