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_envsuses 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 ofUnityEnvironment.- Communication between Unity and the Python
UnityEnvironmentis 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)
| File | Size | Uploaded | |
|---|---|---|---|
| mlagents_envs-1.1.0.tar.gz | 57.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|