Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Having trouble setting up Python environment.

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

  1. Jason-K

    Jason-K

    Joined:
    Dec 1, 2014
    Posts:
    35
    I found instructions for setting up a the Python environment for using ml agents on windows here (https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation.md). 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

    celion_unity

    Joined:
    Jun 12, 2019
    Posts:
    289
    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.