Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ffbb5b2
Release 4.0.0 (#6220)
maryamziaa Aug 25, 2025
bf59b0e
Update release_22 changes
maryamziaa Aug 25, 2025
fa7742e
Update table format
maryamziaa Aug 25, 2025
6740d89
Minor edit
maryamziaa Aug 25, 2025
3928cba
Update notebook image sources to reference GitHub URLs.
maryamziaa Aug 25, 2025
73d1328
Typo
maryamziaa Aug 25, 2025
3af83de
Move readme out of the package docs.
maryamziaa Aug 26, 2025
4a06dc6
Update doc links in readme
maryamziaa Aug 26, 2025
2aa55e9
Update doc links in readme
maryamziaa Aug 26, 2025
1ce089a
Change PNG to png to make Package Prom happy.
maryamziaa Aug 26, 2025
a891e80
Update XML doc comments.
maryamziaa Aug 26, 2025
dd42896
Update XML documentation for public APIs
maryamziaa Aug 26, 2025
a1f33a5
Pre-commit checks.
maryamziaa Aug 26, 2025
ec40182
Update XML documentation comments.
maryamziaa Aug 26, 2025
be3d72e
Update installation doc
maryamziaa Aug 28, 2025
20f90ba
Update
maryamziaa Aug 28, 2025
2294f78
Update latest release date
maryamziaa Sep 2, 2025
4662162
resolve conflicts
maryamziaa Sep 2, 2025
760a7b7
Fix parameter name in documentation: multirange_uniform -> multirange…
maryamziaa Sep 2, 2025
f6267ec
Update Changelog
maryamziaa Sep 16, 2025
6a52b36
Update changelog
maryamziaa Sep 17, 2025
06f857b
Remove Unreleased section
maryamziaa Sep 17, 2025
bb4f061
Update markdown file
maryamziaa Oct 27, 2025
cde4f67
Update markdown
maryamziaa Oct 27, 2025
7595b2c
Merge branch into the develop branch
maryamziaa Oct 27, 2025
e572d13
Apply suggestions from code review
maryamziaa Oct 29, 2025
dfaa711
Update installation doc
maryamziaa Oct 30, 2025
42b8a01
Last update
maryamziaa Oct 30, 2025
df05b25
Update com.unity.ml-agents/Documentation~/Installation.md
maryamziaa Oct 30, 2025
1bdcd93
Update com.unity.ml-agents/Documentation~/Installation.md
maryamziaa Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The table below shows our latest release, including our `develop` branch which i

| **Version** | **Release Date** | **Source** | **Documentation** | **Download** | **Python Package** | **Unity Package** |
|:----------------------:|:-------------------:|:-----------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------:|:-----------------------------------------------------:|:-------------------------------------------------------------------------------------:|
| **Release 23** | **August 15, 2025** | **[source](https://github.com/Unity-Technologies/ml-agents/tree/release_23)** | **[docs](https://docs.unity3d.com/Packages/[email protected]/manual/index.html)** | **[download](https://github.com/Unity-Technologies/ml-agents/archive/release_23.zip)** | **[1.1.0](https://pypi.org/project/mlagents/1.1.0/)** | **4.0.0** |
| **Release 23** | **August 28, 2025** | **[source](https://github.com/Unity-Technologies/ml-agents/tree/release_23)** | **[docs](https://docs.unity3d.com/Packages/[email protected]/manual/index.html)** | **[download](https://github.com/Unity-Technologies/ml-agents/archive/release_23.zip)** | **[1.1.0](https://pypi.org/project/mlagents/1.1.0/)** | **4.0.0** |
| **develop (unstable)** | -- | [source](https://github.com/Unity-Technologies/ml-agents/tree/develop) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/develop/com.unity.ml-agents/Documentation~/index.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/develop.zip) | -- | -- |


Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.0.0] - 2025-08-15
## [4.0.0] - 2025-08-28
### Major Changes
#### com.unity.ml-agents (C#)
- Upgraded to Inference Engine 2.2.1 (#6212)
Expand Down
98 changes: 47 additions & 51 deletions com.unity.ml-agents/Documentation~/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,50 @@
To install and use the ML-Agents Toolkit, follow the steps below. Detailed instructions for each step are provided later on this page.

1. Install Unity (6000.0 or later)
2. Install Python (>= 3.10.1, <=3.10.12) - we recommend using 3.10.12
3. Install the `com.unity.ml-agents` Unity package; or clone this repository and install locally (recommended for the latest version and bug fixes)
4. Install `mlagents-envs`
5. Install `mlagents`
2. Install Python using conda (>= 3.10.1, <=3.10.12) - we recommend using 3.10.12
3. Install ML-Agents using one of the following methods:

### Install **Unity 6000.0** or Later
3.1 Package installation

[Download](https://unity3d.com/get-unity/download) and install Unity. We strongly recommend that you install Unity through the Unity Hub as it will enable you to manage multiple Unity versions.
3.2 Advanced installation

## 1. Install **Unity 6000.0** or Later

### Install **Python 3.10.12**
[Download](https://unity3d.com/get-unity/download) and install Unity. We strongly recommend that you install Unity through the Unity Hub as it will enable you to manage multiple Unity versions.

We recommend [installing](https://www.python.org/downloads/) Python 3.10.12. If you are using Windows, please install the x86-64 version and not x86. If your Python environment doesn't include `pip3`, see these [instructions](https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers) on installing it. We also recommend using [conda](https://docs.conda.io/en/latest/) or [mamba](https://github.com/mamba-org/mamba) to manage your python virtual environments.
## 2. Install **Python 3.10.12** using Conda

#### Conda python setup
We recommend using [conda](https://docs.conda.io/en/latest/) or [mamba](https://github.com/mamba-org/mamba) to install and manage Python environments.

Once conda has been installed in your system, open a terminal and execute the following commands to setup a python 3.10.12 virtual environment and activate it.
Once conda has been installed on your system, open a terminal and execute the following commands to set up a Python 3.10.12 virtual environment and activate it:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Once conda has been installed on your system, open a terminal and execute the following commands to set up a Python 3.10.12 virtual environment and activate it:
To install Python, follow these steps:
1. Install [Conda](https://docs.conda.io/en/latest/) or [Mamba](https://github.com/mamba-org/mamba).
2. Open a terminal and create a new Conda environment with Python 3.10.12:
```shell
conda create -n mlagents python=3.10.12 && conda activate mlagents
  1. On Windows, install PyTorch separately to ensure CUDA support:

    pip3 install torch~=2.2.1 --index-url https://download.pytorch.org/whl/cu121

    If prompted, install Microsoft Visual C++ Redistributable. For more installation options and versions, refer to the PyTorch installation guide.


```shell
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```shell

conda create -n mlagents python=3.10.12 && conda activate mlagents
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
conda create -n mlagents python=3.10.12 && conda activate mlagents

```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```


### Install the `com.unity.ml-agents` Unity package

The Unity ML-Agents C# SDK is a Unity Package. You can install the `com.unity.ml-agents` package [directly from the Package Manager registry](https://docs.unity3d.com/Manual/upm-ui-install.html). Please make sure you enable 'Preview Packages' in the 'Advanced' dropdown in order to find the latest Preview release of the package.

**NOTE:** If you do not see the ML-Agents package listed in the Package Manager please follow the advanced installation instructions below.

#### Advanced: Local Installation for Development

You will need to clone the repository if you plan to modify or extend the ML-Agents Toolkit for your purposes, or if you'd like to download our example environments. Some of our tutorials / guides assume you have access to our example environments.

Use the command below to clone the repository
On Windows, you'll have to install the PyTorch package separately prior to installing ML-Agents in order to make sure the cuda-enabled version is used, rather than the CPU-only version. Activate your virtual environment and run from the command line:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
On Windows, you'll have to install the PyTorch package separately prior to installing ML-Agents in order to make sure the cuda-enabled version is used, rather than the CPU-only version. Activate your virtual environment and run from the command line:


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

```sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```sh

git clone --branch release_23 https://github.com/Unity-Technologies/ml-agents.git
pip3 install torch~=2.2.1 --index-url https://download.pytorch.org/whl/cu121
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pip3 install torch~=2.2.1 --index-url https://download.pytorch.org/whl/cu121

```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```


The `--branch release_23` option will switch to the tag of the latest stable release. Omitting that will get the `develop` branch which is potentially unstable. However, if you find that a release branch does not work, the recommendation is to use the `develop` branch as it may have potential fixes for bugs and dependency issues.
Note that on Windows, you may also need Microsoft's Visual C++ Redistributable if you don't have it already. See the [PyTorch installation guide](https://pytorch.org/get-started/locally/) for more installation options and versions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note that on Windows, you may also need Microsoft's Visual C++ Redistributable if you don't have it already. See the [PyTorch installation guide](https://pytorch.org/get-started/locally/) for more installation options and versions.


(Optional to get bleeding edge)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

```sh
git clone https://github.com/Unity-Technologies/ml-agents.git
```
## 3.1 Install ML-Agents - Package Installation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 3.1 Install ML-Agents - Package Installation
## Install ML-Agents

Use this installation method if you do not plan to modify or extend the ML-Agents Toolkit for your purposes and you don't need access to our example environments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use this installation method if you do not plan to modify or extend the ML-Agents Toolkit for your purposes and you don't need access to our example environments.
You can install ML-Agents in two ways:
* Package installation: Recommended for most users who want to use ML-Agents without modifying the source code.
* Advanced installation: For contributors, developers extending ML-Agents, or users who want access to the example environments.


If you plan to contribute those changes back, make sure to clone the `develop` branch (by omitting `--branch release_23` from the command above). See our [Contributions Guidelines](CONTRIBUTING.md) for more information on contributing to the ML-Agents Toolkit.
### 3.1.1 Install the `com.unity.ml-agents` Unity package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 3.1.1 Install the `com.unity.ml-agents` Unity package
### Install ML-Agents (Package installation)
Use this method if you don’t plan to modify the toolkit or need the example environments.
#### Install the Unity package
To install the package, follow these steps:
1. In Unity, open **Window** > **Package Manager**.
2. Select **+** > **Add package by name**.
3. Enter `com.unity.ml-agents`.
4. Enable **Preview Packages** under the **Advanced** drop-down list if the package doesn’t appear.
If the package isn’t listed, follow the [Advanced Installation](#32-install-ml-agents---advanced-installation) method instead.


You can [add the local](https://docs.unity3d.com/Manual/upm-ui-local.html) `com.unity.ml-agents` package (from the repository that you just cloned) to your project by:

1. navigating to the menu `Window` -> `Package Manager`.
2. In the package manager window click on the `+` button on the top left of the packages list).
3. Select `Add package from disk...`
4. Navigate into the `com.unity.ml-agents` folder.
5. Select the `package.json` file.

<p align="center"> <img src="images/unity_package_manager_window.png" alt="Unity Package Manager Window" height="150" border="10" /> <img src="images/unity_package_json.png" alt="package.json" height="150" border="10" /> </p>
The Unity ML-Agents C# SDK is a Unity Package. You can install the `com.unity.ml-agents` package [directly from the Package Manager registry](https://docs.unity3d.com/Manual/upm-ui-install.html). Please make sure you enable 'Preview Packages' in the 'Advanced' dropdown in order to find the latest Preview release of the package.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Unity ML-Agents C# SDK is a Unity Package. You can install the `com.unity.ml-agents` package [directly from the Package Manager registry](https://docs.unity3d.com/Manual/upm-ui-install.html). Please make sure you enable 'Preview Packages' in the 'Advanced' dropdown in order to find the latest Preview release of the package.


If you are going to follow the examples from our documentation, you can open the
`Project` folder in Unity and start tinkering immediately.
**NOTE:** If you do not see the ML-Agents package listed in the Package Manager please follow the [Advanced Installation](#32-install-ml-agents---advanced-installation) instructions at the bottom of this page.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**NOTE:** If you do not see the ML-Agents package listed in the Package Manager please follow the [Advanced Installation](#32-install-ml-agents---advanced-installation) instructions at the bottom of this page.


### Install Python package
### 3.1.2 Install Python package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 3.1.2 Install Python package
### Install the Python package


Installing the `mlagents` Python package involves installing other Python packages that `mlagents` depends on. So you may run into installation issues if your machine has older versions of any of those dependencies already installed. Consequently, our supported path for installing `mlagents` is to leverage Python Virtual Environments. Virtual Environments provide a mechanism for isolating the dependencies for each project and are supported on Mac / Windows / Linux. We offer a dedicated [guide on Virtual Environments](Using-Virtual-Environment.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Installing the `mlagents` Python package involves installing other Python packages that `mlagents` depends on. So you may run into installation issues if your machine has older versions of any of those dependencies already installed. Consequently, our supported path for installing `mlagents` is to leverage Python Virtual Environments. Virtual Environments provide a mechanism for isolating the dependencies for each project and are supported on Mac / Windows / Linux. We offer a dedicated [guide on Virtual Environments](Using-Virtual-Environment.md).
Install the ML-Agents Python package to enable communication between Unity and your machine learning training environment.
Using a Python virtual environment helps isolate project dependencies and prevent version conflicts across your system. Virtual environments are supported on macOS, Windows, and Linux. For more information, refer to [Using Virtual Environments](https://github.com/Unity-Technologies/ml-agents/pull/6242/files/Using-Virtual-Environment.md).
1. Before installing ML-Agents, activate the Conda environment you created:

conda activate mlagents


2. Install the ML-Agents Python package from the Python Package Index (PyPI):

python -m pip install mlagents==1.1.0


Make sure to install a Python package version that matches your Unity ML-Agents package version. For information on compatible versions, refer to the [ML-Agents release history](https://github.com/Unity-Technologies/ml-agents/releases).

3. If you encounter an error while building the `grpcio` wheel, install it separately before reinstalling ML-Agents:

conda install "grpcio=1.48.2" -c conda-forge


This step resolves dependency conflicts that can occur with older versions of `grpcio`.

4. When the installation completes successfully, all the required Python dependencies listed in the [setup.py file](https://github.com/Unity-Technologies/ml-agents/blob/release/4.0.0/ml-agents/setup.py), including [PyTorch](Background-PyTorch.md) are automatically configured.


#### Installing `mlagents` from PyPi

You can install the ML-Agents Python package directly from PyPi. This is the recommended approach if you installed the C# package via the Package Manager registry.
You can install the ML-Agents Python package directly from PyPi.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can install the ML-Agents Python package directly from PyPi.


**Important:** Ensure you install a Python package version that matches your Unity package version. Check the [release history](https://github.com/Unity-Technologies/ml-agents/releases) to find compatible versions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Important:** Ensure you install a Python package version that matches your Unity package version. Check the [release history](https://github.com/Unity-Technologies/ml-agents/releases) to find compatible versions.


Expand All @@ -87,19 +64,40 @@ conda install "grpcio=1.48.2" -c conda-forge
When you install the Python package, the dependencies listed in the [setup.py file](https://github.com/Unity-Technologies/ml-agents/blob/release/4.0.0/ml-agents/setup.py) are also installed. These include [PyTorch](Background-PyTorch.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When you install the Python package, the dependencies listed in the [setup.py file](https://github.com/Unity-Technologies/ml-agents/blob/release/4.0.0/ml-agents/setup.py) are also installed. These include [PyTorch](Background-PyTorch.md).



#### Advanced: Local Installation for Development
## 3.2 Install ML-Agents - Advanced Installation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 3.2 Install ML-Agents - Advanced Installation
### Install ML-Agents (Advanced Installation)
Use the advanced installation method if you plan to modify or extend the ML-Agents Toolkit, or if you want to download and use the example environments included in the repository.


##### (Windows) Installing PyTorch
You will need to clone the repository if you plan to modify or extend the ML-Agents Toolkit for your purposes, or if you'd like to download our example environments. Some of our tutorials / guides assume you have access to our example environments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You will need to clone the repository if you plan to modify or extend the ML-Agents Toolkit for your purposes, or if you'd like to download our example environments. Some of our tutorials / guides assume you have access to our example environments.
#### Clone the ML-Agents repository
Clone the ML-Agents repository to access the source code, sample environments, and development branches.
To clone the latest stable release, run:

git clone --branch release_23 https://github.com/Unity-Technologies/ml-agents.git


The `--branch release_23` flag checks out the latest stable release. If you omit this option, the `develop` branch is cloned instead, which may contain experimental or unstable changes.

If the `release` branch does not work as expected, switch to the `develop` branch. It may include fixes for dependency or compatibility issues.

To clone the bleeding-edge development version (optional), run:

git clone https://github.com/Unity-Technologies/ml-agents.git


If you plan to contribute your changes, clone the `develop` branch (omit the `--branch` flag). For more information, refer to the [Contribution Guidelines](https://github.com/Unity-Technologies/ml-agents/pull/6242/files/CONTRIBUTING.md).


On Windows, you'll have to install the PyTorch package separately prior to installing ML-Agents in order to make sure the cuda-enabled version is used, rather than the CPU-only version. Activate your virtual environment and run from the command line:
Use the command below to clone the repository:

```sh
pip3 install torch~=2.2.1 --index-url https://download.pytorch.org/whl/cu121
git clone --branch release_23 https://github.com/Unity-Technologies/ml-agents.git
```

Note that on Windows, you may also need Microsoft's Visual C++ Redistributable if you don't have it already. See the [PyTorch installation guide](https://pytorch.org/get-started/locally/) for more installation options and versions.
The `--branch release_23` option will switch to the tag of the latest stable release. Omitting that will get the `develop` branch which is potentially unstable. However, if you find that a release branch does not work, the recommendation is to use the `develop` branch as it may have potential fixes for bugs and dependency issues.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `--branch release_23` option will switch to the tag of the latest stable release. Omitting that will get the `develop` branch which is potentially unstable. However, if you find that a release branch does not work, the recommendation is to use the `develop` branch as it may have potential fixes for bugs and dependency issues.


To get the bleeding-edge development version (optional):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To get the bleeding-edge development version (optional):


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

```sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```sh

git clone https://github.com/Unity-Technologies/ml-agents.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
git clone https://github.com/Unity-Technologies/ml-agents.git

```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```


##### All Platforms
If you plan to contribute those changes back, make sure to clone the `develop` branch (by omitting `--branch release_23` from the command above). See our [Contributions Guidelines](CONTRIBUTING.md) for more information on contributing to the ML-Agents Toolkit.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you plan to contribute those changes back, make sure to clone the `develop` branch (by omitting `--branch release_23` from the command above). See our [Contributions Guidelines](CONTRIBUTING.md) for more information on contributing to the ML-Agents Toolkit.


### 3.2.1 Add the `com.unity.ml-agents` Unity package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 3.2.1 Add the `com.unity.ml-agents` Unity package
#### Add the ML-Agents Unity package
After cloning the repository, add the `com.unity.ml-agents` Unity package to your project.
To add the local package, follow these steps:
1. In the Unity Editor, go to **Window** > **Package Manager**.
2. In the **Package Manager** window, select **+**.
3. Select **Add package from disk**.
4. Navigate to the cloned repository and open the `com.unity.ml-agents` folder.
5. Select the `package.json` file.
Unity adds the ML-Agents package to your project.
If you plan to use the example environments provided in the repository, open the **Project** folder in Unity to explore and experiment with them.

You can [add the local](https://docs.unity3d.com/Manual/upm-ui-local.html) `com.unity.ml-agents` package (from the repository that you just cloned) to your project by:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can [add the local](https://docs.unity3d.com/Manual/upm-ui-local.html) `com.unity.ml-agents` package (from the repository that you just cloned) to your project by:


1. Navigating to the menu `Window` -> `Package Manager`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Navigating to the menu `Window` -> `Package Manager`.

2. In the package manager window, click on the `+` button on the top left of the packages list.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. In the package manager window, click on the `+` button on the top left of the packages list.

3. Select `Add package from disk...`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Select `Add package from disk...`

4. Navigate into the `com.unity.ml-agents` folder.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. Navigate into the `com.unity.ml-agents` folder.

5. Select the `package.json` file.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Select the `package.json` file.


<p align="center"> <img src="images/unity_package_manager_window.png" alt="Unity Package Manager Window" height="150" border="10" /> <img src="images/unity_package_json.png" alt="package.json" height="150" border="10" /> </p>

If you are going to follow the examples from our documentation, you can open the `Project` folder in Unity and start tinkering immediately.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you are going to follow the examples from our documentation, you can open the `Project` folder in Unity and start tinkering immediately.


### 3.2.2 Install Python package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 3.2.2 Install Python package
#### Install the ML-Agents Python package
Install the Python packages from the cloned repository to enable training and environment communication.
1. From the root of the cloned repository, activate your virtual environment and run:

cd /path/to/ml-agents
python -m pip install ./ml-agents-envs
python -m pip install ./ml-agents


This installs the ML-Agents packages directly from the cloned source, not from PyPI.

2. To confirm a successful installation, run:

mlagents-learn --help


If the command lists available parameters, your setup is complete.

3. If you plan to modify the ML-Agents source code or contribute changes, install the packages in editable mode.

Editable installs let you make live changes to the Python files and test them immediately.

From the repository’s root directory, run:

pip3 install torch -f https://download.pytorch.org/whl/torch_stable.html
pip3 install -e ./ml-agents-envs
pip3 install -e ./ml-agents


> [!NOTE]  
> Install the packages in this order. The `mlagents` package depends on `mlagents_envs`. Installing them in the reverse order causes `mlagents_envs` to be downloaded from PyPI, which can cause version mismatches.


To install the `mlagents` Python package, activate your virtual environment and run from the command line:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may please delete all the following information as it has been covered in the steps above.


Expand All @@ -111,8 +109,6 @@ python -m pip install ./ml-agents

Note that this will install `mlagents` from the cloned repository, _not_ from the PyPi repository. If you installed this correctly, you should be able to run `mlagents-learn --help`, after which you will see the command line parameters you can use with `mlagents-learn`.



If you intend to make modifications to `mlagents` or `mlagents_envs`, from the repository's root directory, run:

```sh
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Documentation~/Training-ML-Agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ Below is a list of the `sampler_type` values supported by the toolkit.
- `gaussian` - Gaussian sampler
- Samples a single float value from a normal distribution with a given mean and standard deviation.
- **parameters** - `mean`, `st_dev`
- `multirange_uniform` - Multirange uniform sampler
- `multirangeuniform` - Multirange uniform sampler
- First, samples an interval from a set of intervals in proportion to relative length of the intervals. Then, uniformly samples a single float value from the sampled interval (inclusive). This sampler can take an arbitrary number of intervals in a list in the following format: [[`interval_1_min`, `interval_1_max`], [`interval_2_min`, `interval_2_max`], ...]
- **parameters** - `intervals`

Expand Down