5

I'm trying to set up OpenAI's gym on Windows 10, so that I can do machine learning with Atari games.

On PyCharm I've successfully installed gym using Settings > Project Interpreter. But when I try to set up a breakout environment (or any other Atari game) using:

import gym
env = gym.make('BreakoutDeterministic-v4')

I get the following error:

ImportError: No module named 'atari_py'
...
HINT: you can install Atari dependencies by running 'pip install gym[atari]'

So I tried the command 'pip install gym[atari]' in the PyCharm terminal, and got the error:

Unable to execute 'make build -C atari_py/ale_interface -j 11'. HINT: are you sure `make` is installed?
error: [WinError 2] The system cannot find the file specified

I tried installing 'make' from http://gnuwin32.sourceforge.net/packages/make.htm, and tried some other methods, but this didn't solve the problem.

I've also tried 'pip install atari_py', which runs fine but also doesn't solve the problem.

Any ideas/help would be much appreciated. I'm new to Python and PyCharm, so I apologise if any of this was unclear. Please let me know if there's any more info I can provide to help.

Thanks in advance

Paul K
  • 51
  • 1
  • 3
  • 1
    Possible duplicate of [OpenAI Gym Atari on Windows](https://stackoverflow.com/questions/42605769/openai-gym-atari-on-windows) – Nikita Kniazev Dec 02 '18 at 19:51

2 Answers2

1

The gym documentation https://github.com/openai/gym#installing-everything says that for using all the environments, you should have installed dependencies through pip install 'gym[all]'. Can you run this command preferably through the terminal and see if it works?

CS101
  • 444
  • 1
  • 6
  • 21
  • Thanks CS101. I ran `pip install gym[all]`, both via the PyCharm terminal, and by setting up a virtual environment on Anaconda Promt. Using both methods I got the following error: `Unable to execute 'make build -C atari_py/ale_interface -j 11'. HINT: are you sure 'make' is installed?`. I noticed from the gym documentation you linked to that they only give installation instructions for OSX and Ubuntu, and there's no mention of Windows. Perhaps I should just install and start using Ubuntu? – Paul K Nov 21 '18 at 10:14
  • @PaulK, I have been using gym on my windows 7 and windows 10 laptops since beginning of the year. I do not use pycharm. I simply opened terminal and used pip install gym for python 2.7/ pip3 install gym for python 3.6. You can install gym on windows I think. What I believe does not work is dependencies needed for using Atari or Mujoco. I am not aware of the dependencies since I ahve never used them. But pip install through terminal looks like a clean install to me. You can uninstall the current gym and see if reinstalling by my method works. – CS101 Nov 21 '18 at 16:00
  • 1
    I had previously found a suggestion to run 'pip install --no-index -f https://github.com/Kojoley/atari-py/releases atari_py' (see here https://stackoverflow.com/questions/42605769/openai-gym-atari-on-windows/46739299). This didn't work originally. But after much fiddling, this works! Thanks for your help @CS101 – Paul K Nov 21 '18 at 17:36
1

We currently support Linux and OS X running Python 2.7 or 3.5 -- 3.7. Windows support is experimental - algorithmic, toy_text, classic_control and atari should work on Windows (see next section for installation instructions); nevertheless, proceed at your own risk.

https://github.com/openai/gym#supported-systems

I ended up using Windows subsystem for Linux to run OpenAI Gym with Atari on Windows 10. I have written a complete guide here.

Works great!

Dibran
  • 1,435
  • 16
  • 24