MAgent (moved to MAgent2)

Warning

The MAgent environments are no longer part of PettingZoo. They now live in their own Farama project, MAgent2, where they continue to be maintained.

Importing pettingzoo.magent raises an ImportError pointing here.

Migration Guide

Install the new package:

pip install magent2

Then update your imports. The environment names and versions are unchanged, so in most cases swapping the import is the only edit required:

# Before (PettingZoo <= 1.23)
from pettingzoo.magent import battle_v4

# After
from magent2.environments import battle_v4

env = battle_v4.env(render_mode="human")

MAgent2 still implements the PettingZoo AEC and Parallel APIs, so the rest of your code, along with any PettingZoo wrappers and utilities, continues to work.

Environments

The environments that used to be documented on this site are now documented at magent2.farama.org: