'mlagents-learn' is not recognized as an internal or external command, operable program or batch fil

I have created a ml environment on windows and I am trying to train my agent but I get

'mlagents-learn' is not recognized as an internal or external command, operable program or batch file.

when I try to run mlagents-learn with my config file and a run id specified as parameters. I added the path to ml-agents/trainers/learn.py into my PATH environment variable and I followed the instructions for setting up a virtual environment but I get the same results. When I run learn.py from within the trainers directory with command

learn.py config\Platformer.yaml --run-id=Platformer

I get a console window but it closes very quickly and before closing for a split second it says that it's missing the parameter trainer_config_path even though as you can see I certainly specified it. Switching the order of the parameters as well as specifying the full path to my config yaml file doesn't help. I'm sure I'm doing something simple wrong but I can't figure it out. I'm using 64 bit windows.
Can anyone help me? Thanks!

I’ll flag this with the team, and pass along any guidance they have.

Try using Anaconda. I don't know why they don't recommend it, as it's pretty much the standard for Python on Windows. After installation open an Anaconda Prompt and run these:

  • conda create -n mlagents python=3.7
  • activate mlagents
  • pip install mlagents

That's all you need to do to get it working. After that you can run the mlagents-learn command in that environment.

1 Like

We used to have a doc that used Anaconda, but later on we tried to unify the installation workflow across Mac, Linux and Windows, so we decided to remove it.

This works… But why do they have a way to do this without anaconda? I keep trying this new way and without anaconda I can’t get mlagents-learn to work as well… so confusing…

I installed the latest version of Python for Windows 3.8.4 and realised that the pip command did not fully work. Downgraded to Python 3.7 and it all worked fine. I suspect there are version specific commands in some of the scripts along the way.

Thank you very much guys ! I had the same issue (I downloaded python 3.9 -_-'), I installed Anaconda as you said and so far it’s working. \o/ thanks !

1 Like