Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

API Number not compatible with Python

Discussion in 'ML-Agents' started by ninazrdl, Feb 9, 2020.

  1. ninazrdl

    ninazrdl

    Joined:
    Feb 8, 2020
    Posts:
    3
    Hello.
    I know this is an old question, but I've checked the ML-Agents update log and tried to force-update by pip and I am sure my MLA is up-to-date until yesterday. It didn't work.
    Is there a way, say downgrade my Unity API, so that it can work?

    Here is my error info:
    INFO:mlagents_envs:Environment shut down with return code 0 (CTRL_C_EVENT).
    Traceback (most recent call last):
    File "C:/Users/User/PycharmProjects/UnityMLA/unity.py", line 5, in <module>
    env = UnityEnv("C:/Users/User/Desktop/Police-Unity.exe",worker_id=0)
    File "C:\ProgramData\Anaconda3\envs\UnityMLA\lib\site-packages\gym_unity\envs\__init__.py", line 61, in __init__
    environment_filename, worker_id, no_graphics=no_graphics
    File "C:\ProgramData\Anaconda3\envs\UnityMLA\lib\site-packages\mlagents_envs\environment.py", line 135, in __init__
    f"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.
    Please go to https://github.com/Unity-Technologies/ml-agents/releases/tag/latest_releaseto download the latest version of ML-Agents.
     
  2. celion_unity

    celion_unity

    Unity Technologies

    Joined:
    Jun 12, 2019
    Posts:
    289
    Hi,
    "API-14-dev0" means that you were running from the master branch, which might not be compatible with the previous release. You should get the version of the C# code from https://github.com/Unity-Technologies/ml-agents/tree/0.13.1/ and follow the installation documentation from there (not from the master branch).
     
    ninazrdl likes this.
  3. ninazrdl

    ninazrdl

    Joined:
    Feb 8, 2020
    Posts:
    3
    Sorry for the late reply, thank you it is solved.