A Gymnasium-compatible collection of simulated driving environments for training and testing autonomous driving and decision-making agents.
Farama-Foundation/PettingZoo
A Python library providing a standard API and reference environments for multi-agent reinforcement learning research, similar to Gymnasium.
- Stars
- 3,553
- Forks
- 554
- Open issues
- 70
- Last commit
- 8 days ago
What is it?
PettingZoo is a Python library for multi-agent reinforcement learning research. It plays the role for multi-agent settings that Gymnasium plays for single-agent ones: environments share one interface, so researchers can write an algorithm once and run it across many tasks.
Environments are modeled as Agent Environment Cycle (AEC) games, which supports turn-based and simultaneous-action settings under one API. A secondary Parallel API covers games where agents act at the same time. The library ships families of environments, including multi-player Atari 2600 games, cooperative graphical games, classic card and board games, and a set of cooperative SISL tasks.
The base package installs with pip, and per-family extras such as pettingzoo[atari] pull in optional dependencies. Linux and macOS are officially supported. Companion library SuperSuit provides common RL wrappers for PettingZoo and Gymnasium environments, and tutorials show training with CleanRL, Tianshou and AgileRL.
Key features
- 01Standard API for multi-agent environments based on AEC games
- 02Parallel API for games where agents act simultaneously
- 03Environment families covering Atari, cooperative graphical games, classic games and SISL tasks
- 04Gymnasium-like reset, step and iteration interface
- 05Per-family optional installs via pip extras
Use cases
- Benchmarking multi-agent RL algorithms on a shared set of environments
- Prototyping cooperative or competitive agent training
- Building custom multi-agent environments on a standard interface
- Training agents with CleanRL, Tianshou or AgileRL on PettingZoo tasks
Quick start
- 1
Install the base PettingZoo library
pip install pettingzoo - 2
Install dependencies for one environment family (e.g. Atari)
pip install 'pettingzoo[atari]' - 3
Create an environment and run a random-action loop
Things to know
- Officially supported only on Linux and macOS; Windows is not officially supported.
- Some environment families can be difficult to install on certain systems.
In collections
Topics
FAQ
- What is PettingZoo?
- A Python library providing a standard API and reference environments for multi-agent reinforcement learning research, similar to Gymnasium. PettingZoo is a Python library for multi-agent reinforcement learning research. It plays the role for multi-agent settings that Gymnasium plays for single-agent ones: environments share one interface, so researchers can write an algorithm once and run it across many tasks.
- Is PettingZoo free to use? What license does it have?
- PettingZoo is open source under the MIT license. Check the license terms before using it in commercial products.
- Is PettingZoo still maintained?
- Actively maintained. The last commit to PettingZoo was on Oct 30, 2026.
- What can I use PettingZoo for?
- Benchmarking multi-agent RL algorithms on a shared set of environments Prototyping cooperative or competitive agent training Building custom multi-agent environments on a standard interface Training agents with CleanRL, Tianshou or AgileRL on PettingZoo tasks
- How do I install PettingZoo?
- Install the base PettingZoo library: pip install pettingzoo Install dependencies for one environment family (e.g. Atari): pip install 'pettingzoo[atari]' Create an environment and run a random-action loop
- Where can I get PettingZoo?
- The source code and installation instructions are on GitHub: https://github.com/Farama-Foundation/PettingZoo
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A lightweight Python driving simulator for reinforcement learning and autonomous driving research, with sensor simulation and Gymnasium-style environments.
PyBullet-based Gymnasium environments for training single and multi-agent reinforcement learning controllers for quadcopters.
A collection of MuJoCo-based robotics reinforcement learning environments built on the Gymnasium API.
A research platform for studying how automated attacker and defender agents interact in simulated enterprise networks, with an OpenAI Gym interface.
Python package for building Gymnasium reinforcement-learning environments for spacecraft tasking and planning, built on the Basilisk simulator.