skillfed

gymnasium

A standard API for reinforcement learning and a diverse set of reference environments (formerly Gym).

gymnasium v1.3.0 8.4M downloads/30d#1,632 on PyPI12,324
Permissive license MIT License Active released

What it is and what it does

Gymnasium is the maintained successor to OpenAI's Gym library, providing a standardized interface for reinforcement learning research and algorithm development. It defines how learning agents interact with environments through a simple API: agents observe state, take actions, and receive rewards. The library includes built-in environment families (Classic Control, Box2D, Toy Text, MuJoCo, Atari) and supports third-party environments that follow its API contract.

The package is built on numpy, cloudpickle, typing-extensions, and farama-notifications, keeping dependencies minimal for the base install. Environments are versioned strictly (e.g., CartPole-v1) to ensure reproducibility when algorithm results might be affected by environment changes. It is actively developed, production-stable, and widely used in the RL community for benchmarking and prototyping learning algorithms.

Use it for:

  • Prototyping and testing new reinforcement learning algorithms against standard benchmarks like CartPole or MuJoCo control tasks
  • Training agents on Atari 2600 games for research into deep RL methods
  • Debugging RL implementations using simple discrete environments with small state/action spaces
  • Building multi-agent systems via compatible third-party environments like PettingZoo
  • Reproducing published RL research by leveraging strict environment versioning

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Gymnasium provides a standard Python API for building and testing reinforcement learning algorithms against a collection of environments ranging from simple toy problems to complex physics simulations and Atari games.

Yes. Gymnasium is the de facto standard RL environment interface in Python, actively maintained, production-stable, and has no known vulnerabilities. Install friction is low, dependencies are minimal, and the MIT license imposes no restrictions. Essential for anyone working in reinforcement learning research or algorithm development.

Install

gymnasium on PyPI

pip

pip install gymnasium

uv

uv add gymnasium

poetry

poetry add gymnasium

Installing gymnasium

Before you install

Low friction installation with a pure Python wheel. Actively maintained with recent releases; supports Python 3.10, 3.11, 3.12, and 3.13 on Linux and macOS. Base install includes core functionality; optional dependencies available for specific environment families.

License in practice

MIT License permits commercial and private use with minimal restrictions, making it suitable for both research and production projects.

Quickstart

pip install gymnasium

import gymnasium as gym
env = gym.make("CartPole-v1")
observation, info = env.reset(seed=42)
action = env.action_space.sample()
observation, reward, terminated, truncated, info = env.step(action)
env.close()

Requires Python 3.10 or later. Optional environment families (Atari, MuJoCo, Box2D) require additional dependencies installable via pip extras.

Verify before relying

  • Whether third-party environments maintain compatibility across Gymnasium versions without manual intervention
  • Performance characteristics when running large-scale parallel environment instances
  • Windows support status beyond the stated lack of official support

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — numpy, cloudpickle, typing-extensions, farama-notifications
Maintenance actively maintained — 114 days since the last release
Last repo commit
First released
Downloads 8,352,518/month — #1,632 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: gymnasium-1.3.0-py3-none-any.whl

Keywords: Reinforcement Learning, game, RL, AI, gymnasium

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

reinforcement learning environment APIRL algorithm testing frameworkgym environments for agentsstandard RL benchmark suitephysics simulation environmentsatari game environments
reinforcement-learningbenchmarkingsimulation

More Artificial Intelligence packages

Further reading