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.

Release files for mlagents-envs 1.1.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 mlagents-envs 1.1.0
File Size Uploaded
mlagents_envs-1.1.0.tar.gz 57.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlagents-envs 1.1.0
File Interpreter ABI Platform
mlagents_envs-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 147.2 kB

Release files / mlagents_envs-1.1.0.tar.gz

Download URL mlagents_envs-1.1.0.tar.gz
Size 57.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7fb50795ce16b71b5ae7c168dad0341a4cbca3676b62e7c5c53a1caa4038e069
BLAKE2b-256 checksum
How to use checksums
d5d7a5ed11ea04671e47bcc6fdeff227941e8390b26ce5f1be1c2f1456afc122
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / mlagents_envs-1.1.0-py3-none-any.whl

Download URL mlagents_envs-1.1.0-py3-none-any.whl
Size 89.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbb7e54c6327a53f0b7dd615de49414af496e5f766ccc10f175d3731b32bb985
BLAKE2b-256 checksum
How to use checksums
1cd665e4dec29de915c3cd1966d7c02fa2b09a24f762287db5231151f72671de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.30.0

1 release file

0.28.0

2 release files

0.26.0

2 release files

0.25.1

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.1

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.1

2 release files

0.12.1

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

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