OpenAI Gym Atari on Windows

I am having problems installing the OpenAI Gym Atari environment on Windows 10. I have successfully installed and used OpenAI Gym already on the same system.

It tries to disconnect when trying to run a makefile.

I run the pip install gym[atari]

Here is the error:

enter image description here

and this is what I find on my system ... cmake and make set clearly.

enter image description here

+7
python windows openai-gym
source share
4 answers

I finished installing Bash on Ubuntu on Windows and used it to run the OpenAI Gym / Atari environment. OpenAI Gym currently has very limited support for Windows.

+3
source share

Some time ago, I created a plug with Windows support (the developers of the original repository do not merge or even comment on PR and problems). It requires neither MSYS / Cygwin, nor CMake, nor Zlib.

To simply install atari-py wheels (binaries) , use this command:

 pip install --no-index -f https://github.com/Kojoley/atari-py/releases atari_py 

If you have a distutils supported compiler that you can install from sources:

 pip install git+https://github.com/Kojoley/atari-py.git 

Test your installation with a simple example:

 import gym env = gym.make('SpaceInvaders-v0') env.reset() for _ in range(1000): env.step(env.action_space.sample()) env.render('human') 

If you get a "scrambled" conclusion, most likely because your gym out of date .

+11
source share

This is not fully tested because I donโ€™t remember exactly what I did, but currently I have an openAI gym that works with all atari games that are displayed and displayed, as well as matplotlib graphics, when using ubuntu on windows (WSL) . Actually I have sublimetext3 and the spider works too.

So take them as a guide, but I donโ€™t have a โ€œcleanโ€ environment to test them.

First, on Windows, google "xming" (x11 server) and download from sourceforge / install / run. It does its best.

Now in WSL bash, set the display material to work with xming

 sudo apt-get install x11-apps export DISPLAY=localhost:0.0 nano ~/.bashrc #(add export DISPLAY=localhost:0.0 at the end. Ctrl+X to exit/save) sudo apt-get install gnome-calculator #will get you GTK 

Now in WSL bash install Anaconda. this will involve loading the .sh file (for example, with curl -O "[http link to latest anaconda]" and running it with bash [the file].sh . Do not use sudo when installing Anaconda.

After installing anaconda, close WSL and restart it. Now create an environment and activate it

 conda create -n gym python=3.5 anaconda source activate gym 

Now go to the gym repository

 git clone https://github.com/openai/gym.git cd gym 

Now install these dependencies in the gym mentioned in the openai gym regatta

 apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig 

Now install libgcc using conda

 conda install libgcc 

Now create a gym

 pip install -e '.[all]' 

This is basically it. make sure that Xming is running on windows and in a gnome calculator like WSL, and that it should raise the calculator. if not, continue to work on the display side. If so, try running some of the agents in the sample training folder.

I might have missed a couple of additional dependencies along the way, but these were the things I figured out based on the error messages.

Here's a pic to motivate you: enter image description here

EDIT: Today I ran the following command that installed Qt5 as the back, and matplotlib works fine with Qt5Agg as the back (vs TkAgg). This can be useful if you are using something else in WSL that requires Qt5.

sudo apt-get update && sudo apt-get install qtbase5-dev

Alternatively, to find your matplotlibrc and command line type: python import matplotlib print(matplotlib.matplotlib_fname()) quit()

Please note that on ubuntu for windows there is NO GPU SUPPORT . This is the best requested feature in uservoice, but MS has it on the "backlog". If you are interested, vote here

+7
source share

follow these steps:

1. Install xming for windows10 from here: https://sourceforge.net/projects/xming/

2.open bash and enter the following command: sudo apt-get install python-pip

3.sudo apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig

4.git clone https://github.com/openai/gym.git

if you did not install git allready, install it with the following command: sudo apt-get install git

5.cd gym

6.pip install -e '. [all] '

7. then set the environment variable with the following command, which you must do each time you open the bash window: export DISPLAY =: 0

8. Now open python and try to run atari, it should work

+2
source share

All Articles