"The API number is not compatible between Unity and python."

I’m getting this error message from the Anaconda console when starting the training environment and then hitting Play in Unity. (The issue exists on Github too, but the suggested fixes didn’t work for me, so I’m posting here.) I am however using the latest ML-Agents repo both within Unity as well as the ML-Agents folder. I’m using Unity 2019.3.0f and my Barracuda package is shown as up to date.

Fuller error message:
“The API number is not compatible between Unity and python.”
mlagents_envs.exception.UnityEnvironmentException: The API number is not compatible between Unity and python. Python API: API-13, Unity API: API-14-dev0.

Help please? Thanks!

The master branch of the C# code (API-14-dev0) may not be compatible with the pip release of the python code (API-13).

I would recommend using GitHub - Unity-Technologies/ml-agents at latest_release instead of the master branch for the C# code. If you really want to be on the bleeding edge, you can install the python code from the latest checkout with pip install -e {path to ml-agents}

1 Like

Thank you, this fixes this issue!

1 Like

Switching back to tensorflow helped me
(ie mlagents-learn trainer_config.yaml --run-id xxx --tensorflow)