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. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Having trouble setting up Python environment.

Discussion in 'ML-Agents' started by Jason-K, Jun 16, 2020.

  1. Jason-K


    Dec 1, 2014
    I found instructions for setting up a the Python environment for using ml agents on windows here ( I think I followed the instructions correctly, but I am getting errors so obviously I did not. Can anyone help me figure out what I did wrong? I am brand new to Python so I may be missing something that is obvious to others. Errors are shown in bold.

    I downloaded the latest version of Python (3.8.3). I then ran:
    pip3 install mlagents_env
    pip3 install gym_unity
    pip3 install mlagents

    When I run pip3 install mlagents I see this error at the end:
    Collecting tensorflow<3.0,>=1.7 (from mlagents)
    ERROR: Could not find a version that satisfies the requirement tensorflow<3.0,>=1.7 (from mlagents) (from versions: none)
    ERROR: No matching distribution found for tensorflow<3.0,>=1.7 (from mlagents)
    WARNING: You are using pip version 19.2.3, however version 20.1.1 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.

    When I try to run >mlagents-learn --help to test my installation I get this error:
    C:\Users\Game Dev>mlagents-learn --help
    'mlagents-learn' is not recognized as an internal or external command,
    operable program or batch file.

    Any help or advice would be appreciated.

    *** Possibly Solved ***

    It looks like Tensorflow isn't compatible with the latest version of Python (3.8). I uninstalled Python and installed version 3.7. So far things are looking better. I'll post again once I've confirmed that this works in case anyone else finds this thread while looking for a solution to the same problem.
    Last edited: Jun 16, 2020
  2. celion_unity


    Unity Technologies

    Jun 12, 2019
    The latest version of tensorflow (2.2.0) should be compatible with python 3.8, so I'm surprised it was giving you errors. But glad that using python 3.7 seems to be working.