Unity ML agents install


This should be completed by W8 – 1 Mar: Lab 5 – Connectionism. It shouldn’t take longer than 30m to do and we recommend starting as soon as possible so we can help you through any technical problems.


Windows Walkthrough

Mac Walkthrough


OPTIONAL Anaconda install instructions (only do this if you are having difficulty with python versions)

  1. Go to the anaconda installer
  2. Download and install the 64bit version for your OS
    • During the installation make sure to uncheck the option to make python 3.8 your default
  3. Follow the rest of the tutorial normally


This is a modified version of the original unity ml installation instructions. This contains simplified instructions for how to install the required python packages.

The ML-Agents Toolkit contains several components:

  • Unity package (com.unity.ml-agents) contains the Unity C# SDK that will be integrated into your Unity scene.
  • Three Python packages:
    • mlagents contains the machine learning algorithms that enables you to train behaviors in your Unity scene. Most users of ML-Agents will only need to directly install mlagents.
    • mlagents_envs contains a Python API to interact with a Unity scene. It is a foundational layer that facilitates data messaging between Unity scene and the Python machine learning algorithms. Consequently, mlagents depends on mlagents_envs.
    • gym_unity provides a Python-wrapper for your Unity scene that supports the OpenAI Gym interface.
  • Unity Project that contains several example environments that highlight the various features of the toolkit to help you get started.

To install and use the ML-Agents Toolkit you will need to:

  • Install Python 3.7.9
  • Install the mlagents Python package

Install Python 3.7.9

You should install Python 3.7.9 If you are using Windows, please install the x86-64 version and not x86.

  • Do NOT install Python 3.8 -> Unity does not support this and you may run into issues
  • Make sure to check off “Add to path” during the python installation

Although we do not provide support for Anaconda installation on Windows, the previous Windows Anaconda Installation (Deprecated) guide is still available.

Install the mlagents Python package

To install the mlagents Python package open your command prompt and type:

  • If you are on anaconda, you open the command prompt by going to Environment -> base -> open terminal
python -m pip install mlagents

or, if you have multiple verisons of python installed:

py -3.7 -m pip install mlagents

Note that this will install mlagents from PyPi, not from the cloned 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.

By installing the mlagents package, the dependencies listed in the setup.py file are also installed. These include TensorFlow (Requires a CPU w/ AVX support).