Skip to main content

Unity ML-Agents Python Interface

The mlagents_envs Python package is part of the ML-Agents Toolkit. mlagents_envs provides three Python APIs that allows direct interaction with the Unity game engine:

  • A single agent API (Gym API)
  • A gym-like multi-agent API (PettingZoo API)
  • A low-level API (LLAPI)

The LLAPI is used by the trainer implementation in mlagents. mlagents_envs can be used independently of mlagents for Python communication.

Installation

Install the mlagents_envs package with:

python -m pip install mlagents_envs==1.1.0

Usage & More Information

See

for more information on how to use the API to interact with a Unity environment.

For more information on the ML-Agents Toolkit and how to instrument a Unity scene with the ML-Agents SDK, check out the main ML-Agents Toolkit documentation.

Limitations

  • mlagents_envs uses localhost ports to exchange data between Unity and Python. As such, multiple instances can have their ports collide, leading to errors. Make sure to use a different port if you are using multiple instances of UnityEnvironment.
  • Communication between Unity and the Python UnityEnvironment is not secure.
  • On Linux, ports are not released immediately after the communication closes. As such, you cannot reuse ports right after closing a UnityEnvironment.

Metadata

Release files for mlgame3d-envs 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlgame3d-envs 0.2.0
File Size Uploaded Provenance
mlgame3d_envs-0.2.0.tar.gz 74.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mlgame3d-envs 0.2.0
File Interpreter ABI Platform
mlgame3d_envs-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 182.8 kB

Release files / mlgame3d_envs-0.2.0.tar.gz

Download URL mlgame3d_envs-0.2.0.tar.gz
Size 74.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f02a37a8fc8095ddae54bd4b08e11bc4c10efe30bc6866398dc6eaf32577633d
BLAKE2b-256 checksum
How to use checksums
e7c7cb1f6c2a66ad458aa366626c259f0c0decd07712e0cccd403e70799e0c4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.

Transparency log

Release files / mlgame3d_envs-0.2.0-py3-none-any.whl

Download URL mlgame3d_envs-0.2.0-py3-none-any.whl
Size 107.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a11b01ee8d508e152ab575f5e2ea888e8d5e62e491772cbd1dc06408ab4275a
BLAKE2b-256 checksum
How to use checksums
5dc53cd2037679567e87cca31853bdac5c3aabc00728b7952c8652e070e2050a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.

Transparency log

Security for mlgame3d-envs 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mlgame3d_envs-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page