Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Environment:Farama Foundation Gymnasium Python 3 10 Runtime

From Leeroopedia
Knowledge Sources
Domains Reinforcement_Learning, Infrastructure
Last Updated 2026-02-15 03:00 GMT

Overview

Python 3.10+ environment with NumPy, cloudpickle, and typing-extensions as core dependencies for running any Gymnasium environment.

Description

This environment defines the baseline Python runtime and core package dependencies required to run the Gymnasium library. Gymnasium requires Python 3.10 or higher and ships with a minimal set of mandatory dependencies: NumPy for array operations, cloudpickle for serialization (used in vectorized environments), typing-extensions for type hint backports, and farama-notifications for update notifications. All built-in environment families (MuJoCo, Box2D, Classic Control, etc.) require additional optional dependencies installed via extras.

Usage

Use this environment for any Gymnasium workflow. It is the mandatory base prerequisite for all Gymnasium operations including environment creation, space manipulation, wrapper application, and vectorized execution. Every Implementation and Workflow page in this wiki implicitly depends on this environment.

System Requirements

Category Requirement Notes
OS Linux, macOS, or Windows All major platforms supported
Python >= 3.10 Supports 3.10, 3.11, 3.12, 3.13
Disk ~50MB Core package with no optional extras

Dependencies

System Packages

  • No system-level packages required for core functionality

Python Packages

  • `numpy` >= 1.21.0
  • `cloudpickle` >= 1.2.0
  • `typing-extensions` >= 4.3.0
  • `farama-notifications` >= 0.0.1

Optional Extras (installed separately)

  • `gymnasium[classic-control]` — pygame-ce for Classic Control rendering
  • `gymnasium[box2d]` — Box2D + pygame-ce + swig for Box2D environments
  • `gymnasium[mujoco]` — MuJoCo + imageio + packaging for MuJoCo environments
  • `gymnasium[toy-text]` — pygame-ce for Toy Text rendering
  • `gymnasium[jax]` — JAX + jaxlib + flax for functional environments
  • `gymnasium[torch]` — PyTorch for tensor-based wrappers
  • `gymnasium[other]` — moviepy + matplotlib + opencv-python + seaborn

Credentials

No credentials required for core Gymnasium usage.

Quick Install

# Install core Gymnasium
pip install gymnasium

# Install with all optional dependencies
pip install "gymnasium[all]"

# Install specific extras
pip install "gymnasium[mujoco,box2d,classic-control]"

Code Evidence

Python version requirement from `pyproject.toml:11`:

requires-python = ">= 3.10"

Core dependencies from `pyproject.toml:26-31`:

dependencies = [
    "numpy >=1.21.0",
    "cloudpickle >=1.2.0",
    "typing-extensions >=4.3.0",
    "farama-notifications >=0.0.1",
]

Pygame support prompt suppression from `gymnasium/__init__.py:28`:

os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide"

Common Errors

Error Message Cause Solution
`requires Python >=3.10` Python version too old Upgrade to Python 3.10+
`ModuleNotFoundError: No module named 'gymnasium'` Package not installed `pip install gymnasium`
`DependencyNotInstalled: MuJoCo is not installed` Optional extra not installed `pip install "gymnasium[mujoco]"`
`DependencyNotInstalled: Box2D is not installed` Optional extra not installed `pip install swig && pip install "gymnasium[box2d]"`

Compatibility Notes

  • Python 3.9 and below: Not supported. Gymnasium requires Python >= 3.10.
  • NumPy 2.x: Required for Array API functionality (`gymnasium[array-api]` extra requires numpy >= 2.1.0).
  • Gym (OpenAI) migration: For environments built on old `gym.Env`, install shimmy: `pip install "shimmy[gym-v21]"` or `pip install "shimmy[gym-v26]"`.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment