# Unity ML-Agents Python Interface
The `mlagents_envs` Python package is part of the
[ML-Agents Toolkit](https://github.com/Unity-Technologies/ml-agents).
`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:
```sh
python -m pip install mlagents_envs==1.1.0
```
## Usage & More Information
See
- [Gym API Guide](../docs/Python-Gym-API.md)
- [PettingZoo API Guide](../docs/Python-PettingZoo-API.md)
- [Python API Guide](../docs/Python-LLAPI.md)
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](../docs/Readme.md).
## 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`.
Raw data
{
"_id": null,
"home_page": "https://github.com/Unity-Technologies/ml-agents",
"name": "mlagents-envs",
"maintainer": null,
"docs_url": null,
"requires_python": "<=3.10.12,>=3.10.1",
"maintainer_email": null,
"keywords": null,
"author": "Unity Technologies",
"author_email": "ML-Agents@unity3d.com",
"download_url": "https://files.pythonhosted.org/packages/d5/d7/a5ed11ea04671e47bcc6fdeff227941e8390b26ce5f1be1c2f1456afc122/mlagents_envs-1.1.0.tar.gz",
"platform": null,
"description": "# Unity ML-Agents Python Interface\n\nThe `mlagents_envs` Python package is part of the\n[ML-Agents Toolkit](https://github.com/Unity-Technologies/ml-agents).\n`mlagents_envs` provides three Python APIs that allows direct interaction with the\nUnity game engine:\n- A single agent API (Gym API)\n- A gym-like multi-agent API (PettingZoo API)\n- A low-level API (LLAPI)\n\nThe LLAPI is used by the trainer implementation in `mlagents`.\n`mlagents_envs` can be used independently of `mlagents` for Python\ncommunication.\n\n## Installation\n\nInstall the `mlagents_envs` package with:\n\n```sh\npython -m pip install mlagents_envs==1.1.0\n```\n\n## Usage & More Information\n\nSee\n- [Gym API Guide](../docs/Python-Gym-API.md)\n- [PettingZoo API Guide](../docs/Python-PettingZoo-API.md)\n- [Python API Guide](../docs/Python-LLAPI.md)\n\nfor more information on how to use the API to interact with a Unity environment.\n\nFor more information on the ML-Agents Toolkit and how to instrument a Unity\nscene with the ML-Agents SDK, check out the main\n[ML-Agents Toolkit documentation](../docs/Readme.md).\n\n## Limitations\n\n- `mlagents_envs` uses localhost ports to exchange data between Unity and\n Python. As such, multiple instances can have their ports collide, leading to\n errors. Make sure to use a different port if you are using multiple instances\n of `UnityEnvironment`.\n- Communication between Unity and the Python `UnityEnvironment` is not secure.\n- On Linux, ports are not released immediately after the communication closes.\n As such, you cannot reuse ports right after closing a `UnityEnvironment`.\n",
"bugtrack_url": null,
"license": null,
"summary": "Unity Machine Learning Agents Interface",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/Unity-Technologies/ml-agents"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1cd665e4dec29de915c3cd1966d7c02fa2b09a24f762287db5231151f72671de",
"md5": "95e7d616dc168895733b06bf4af5c147",
"sha256": "fbb7e54c6327a53f0b7dd615de49414af496e5f766ccc10f175d3731b32bb985"
},
"downloads": -1,
"filename": "mlagents_envs-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "95e7d616dc168895733b06bf4af5c147",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<=3.10.12,>=3.10.1",
"size": 89578,
"upload_time": "2024-10-05T14:22:35",
"upload_time_iso_8601": "2024-10-05T14:22:35.910640Z",
"url": "https://files.pythonhosted.org/packages/1c/d6/65e4dec29de915c3cd1966d7c02fa2b09a24f762287db5231151f72671de/mlagents_envs-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d5d7a5ed11ea04671e47bcc6fdeff227941e8390b26ce5f1be1c2f1456afc122",
"md5": "e4fe0d85ee0e773b99da6221c7588753",
"sha256": "7fb50795ce16b71b5ae7c168dad0341a4cbca3676b62e7c5c53a1caa4038e069"
},
"downloads": -1,
"filename": "mlagents_envs-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "e4fe0d85ee0e773b99da6221c7588753",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<=3.10.12,>=3.10.1",
"size": 57616,
"upload_time": "2024-10-05T14:22:37",
"upload_time_iso_8601": "2024-10-05T14:22:37.624544Z",
"url": "https://files.pythonhosted.org/packages/d5/d7/a5ed11ea04671e47bcc6fdeff227941e8390b26ce5f1be1c2f1456afc122/mlagents_envs-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-05 14:22:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Unity-Technologies",
"github_project": "ml-agents",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"test_requirements": [
{
"name": "pytest",
"specs": [
[
">=",
"6.2.5"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
">=",
"2.12.1"
]
]
},
{
"name": "pytest-xdist",
"specs": [
[
">=",
"2.5.0"
]
]
},
{
"name": "filelock",
"specs": [
[
">=",
"3.4.2"
]
]
}
],
"lcname": "mlagents-envs"
}