- Install the Unity Hub
- Use the hub to install the latest LTS (long-term support) editor (e.g., 2020.3.6f1 LTS)
- No additional modules are needed during the editor install, so accept the defaults
- Use the hub to add a NEW project
- Specify the location for the project
- The default editor will be used
- Use the hub to ADD an existing project
- Select the folder that contains the project and it will import it and launch the editor
- When using git, be sure to include a Unity-specific .gitignore, as Unity projects include many large intermediate files that are not necessary to preserve in a repo
- Packages provide editor extensions and code libraries
- Assets provide the content for your game
- Scripts provide the code for your game
- Preferred editor: JetBrains Rider
- Install and configure the JetBrains Rider Editor package
- Preferred editor: JetBrains Rider
ML-Agents requires use of Python. There are a variety of ways to get Python working on your system, depending on OS, package manager, IDE, or data science environment (e.g., Anaconda). We won't cover them all here, rather just provide a few notes that might be useful, depending on your circumstances.
Note that the Python setup instructions suggest to create a system-wide virtual environments folder (e.g.,
~/python-envs), we prefer to keep virtual environments within a repo/project root
Virtual environments are specific to each user, so they are excluded from the git repository and you should create your own. The project-level
.gitignoreexcludes thevenvdirectory at the repo/project root
For the latest version of Python, check the official releases page, which is useful when using pyenv to manage version (see below), or with pyenv itself:
pyenv install --listFrom The right and wrong way to set python 3 as default on a mac:
pyenv install 3.9.4
pyenv global 3.9.4Add the following to your .bashrc, .bash_profile, .zshrc, or whatever is your preference:
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fiConfirm after sourcing or opening a new terminal:
python --version
Python 3.9.4To activate the environment:
source venv/bin/activateand note that your prompt has been modified with a prefix of venv.
The official Python installer can be used to install the latest version.
Be sure to "Install for all users" in order to use virtual environments (
venv) due to this issue.
First, ensure you have the latest pip (within your virtual environment):
python -m pip install --upgrade pipInstall PyTorch (Windows Only):
pip3 install torch~=1.7.1 -f https://download.pytorch.org/whl/torch_stable.htmlInstall the mlagents Python package:
python -m pip install mlagents==0.26.0This will install all the required dependencies (e.g., PyTorch, Tensorboard).
Confirm the installation was successful with the following command (it might take awhile):
mlagents-learn --helpmlagents-learn --run-id=<model name>