Skip to content

Commit 61a9a6c

Browse files
committed
Update installation doc
1 parent 8d616f0 commit 61a9a6c

File tree

1 file changed

+30
-24
lines changed

1 file changed

+30
-24
lines changed

com.unity.ml-agents/Documentation~/Installation.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ project by:
9494
If you are going to follow the examples from our documentation, you can open the
9595
`Project` folder in Unity and start tinkering immediately.
9696

97-
### Install `mlagents-envs` and `mlagents`
97+
### Install Python package
9898

9999
Installing the `mlagents` Python package involves installing other Python
100100
packages that `mlagents` depends on. So you may run into installation issues if
@@ -104,7 +104,33 @@ Virtual Environments. Virtual Environments provide a mechanism for isolating the
104104
dependencies for each project and are supported on Mac / Windows / Linux. We
105105
offer a dedicated [guide on Virtual Environments](Using-Virtual-Environment.md).
106106

107-
#### (Windows) Installing PyTorch
107+
#### Installing `mlagents` from PyPi
108+
109+
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.
110+
111+
**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.
112+
113+
To install, activate your virtual environment and run the following command:
114+
115+
```shell
116+
python -m pip install mlagents==1.1.0
117+
```
118+
119+
which will install the latest version of ML-Agents Python packages and associated dependencies available on PyPi.
120+
If building the wheel for `grpcio` fails, run the following command before installing `mlagents` with pip:
121+
122+
```shell
123+
conda install "grpcio=1.48.2" -c conda-forge
124+
```
125+
126+
When you install the Python package, the dependencies listed in the
127+
[setup.py file](https://github.com/Unity-Technologies/ml-agents/blob/release_22/ml-agents/setup.py) are also installed. These include
128+
[PyTorch](Background-PyTorch.md).
129+
130+
131+
#### Advanced: Local Installation for Development
132+
133+
##### (Windows) Installing PyTorch
108134

109135
On Windows, you'll have to install the PyTorch package separately prior to
110136
installing ML-Agents in order to make sure the cuda-enabled version is used,
@@ -119,7 +145,7 @@ Note that on Windows, you may also need Microsoft's
119145
Visual C++ Redistributable if you don't have it already. See the [PyTorch installation guide](https://pytorch.org/get-started/locally/)
120146
for more installation options and versions.
121147

122-
#### Installing `mlagents`
148+
##### All Platforms
123149

124150
To install the `mlagents` Python package, activate your virtual environment and
125151
run from the command line:
@@ -135,29 +161,9 @@ repository. If you installed this correctly, you should be able to run
135161
`mlagents-learn --help`, after which you will see the command
136162
line parameters you can use with `mlagents-learn`.
137163

138-
You can also install the python package from PyPi by executing the following command:
139-
140-
```shell
141-
python -m pip install mlagents==1.1.0
142-
```
143-
144-
which will install the latest version of ML-Agents and associated dependencies available on PyPi.
145-
If building the wheel for `grpcio` fails, run the following command before installing `mlagents` with pip:
146-
147-
```shell
148-
conda install "grpcio=1.48.2" -c conda-forge
149-
```
150-
151-
Note, you need to have the matching version of
152-
the Unity packages with the particular release of the python packages. You can find the release history [here](https://github.com/Unity-Technologies/ml-agents/releases)
153164

154-
When you install the `mlagents` package, the dependencies listed in the
155-
[setup.py file](https://github.com/Unity-Technologies/ml-agents/blob/release_22/ml-agents/setup.py) are also installed. These include
156-
[PyTorch](Background-PyTorch.md).
157165

158-
If you intend to make modifications to `mlagents` or `mlagents_envs`, you should
159-
install the packages from the cloned repository rather than from PyPi. To do
160-
this, you will need to install `mlagents` and `mlagents_envs` separately. From
166+
If you intend to make modifications to `mlagents` or `mlagents_envs`, from
161167
the repository's root directory, run:
162168

163169
```sh

0 commit comments

Comments
 (0)