Skip to content

Windows support #11

@salarian

Description

@salarian

It would be nice if you could add support for Windows.

Activity

andrewssobral

andrewssobral commented on Apr 28, 2016

@andrewssobral

True

steenblikrs

steenblikrs commented on May 15, 2016

@steenblikrs

Please!! Support windows. I know I should have a dual boot linux distro, but I only have a little solid state. Adding a linux distro would cripple me... Long story short, it would be very convenient to have this available on windows!!

Thank you for all of your hard work thus far.

gdb

gdb commented on May 16, 2016

@gdb
Collaborator

I know a non-trivial number of people are currently using Gym on Windows. I think at this point, it mostly works (with the possible exception of Atari, though I think that too may be not too hard).

We don't have any Windows users at OpenAI currently. Is anyone on this thread interested in doing the work to get Gym fully supported on Windows (which mostly involves getting a CI service set up, and making sure our current functionality actually works there)? Happy to provide guidance.

See also #99.

vrxacs

vrxacs commented on Jun 21, 2016

@vrxacs

Is this still an issue worth resolving? It looks like there was an attempt in #99 but it never really went anywhere. I'd be interested in getting this set up.

gdb

gdb commented on Jun 21, 2016

@gdb
Collaborator

Yep, definitely!

vrxacs

vrxacs commented on Jun 22, 2016

@vrxacs

Alright, then! I'll start looking into it. I'm going to start by setting up a CI service somewhere. Let me know if there's anything else I should be looking into for this issue.

quibsorg

quibsorg commented on Aug 15, 2016

@quibsorg

Any update on this?

maxosmith

maxosmith commented on Aug 28, 2016

@maxosmith

I've got OpenAI gym working on Windows 10 (at least CartPole). Preface: you need to run all the python commands as root because it does path look-ups differently by user.

Very rough instructions:

  1. Update to the latest version of Windows (>version 1607, "Anniversary Update")
  2. Enable Windows Subsystem for Linux (WSL)
  3. Open cmd, run bash
  4. Install python & gym (using sudo, and NOT PIP to install gym). So by now you should probably be able to run things and get really nasty graphics related errors. This is because WSL doesn't support any displays, so we need to fake it.
  5. Install vcXsrv, and run it (you should just have a little tray icon)
  6. In bash run "export DISPLAY=:0" Now when you run it you should get a display to pop-up, there may be issues related to graphics drivers. Sadly, this is where the instructions diverge if you don't have an NVIDIA graphics card.
  7. Get the drivers: "sudo apt-get install nvidia-319 nvidia-settings-319 nvidia-prime"
  8. Run!

Let me know if you have any questions or if I should do a detailed guide.

lunzueta

lunzueta commented on Aug 28, 2016

@lunzueta

@maxosmith Good news! I have one question about this: why nvidia-319 and not a newer version?

lbandy

lbandy commented on Aug 28, 2016

@lbandy

Just a heads-up for anyone not having Windows 10, I'm able to run the gym on Windows 7 using cygwin and ImageMagick, although I haven't tried the atari games yet. One issue though, the recording doesn't seem to work because of ffmpeg issues, but I assume this could be sorted after some investigation.

maxosmith

maxosmith commented on Aug 29, 2016

@maxosmith

@lunzueta I knew it was a safe version for working with vcXsrv, I would imagine newer versions work.

icoxfog417

icoxfog417 commented on Sep 13, 2016

@icoxfog417

@maxosmith Thank you for nice tutorial to enable gym work on Windows! I succeeded to run gym on my Windows PC (bash on Windows/Python 3.5.2). pip install also works fine, below is my setup procedure.

  • install vcXsrv on Windows
  • run bash on Windows
  • install all dependencies
  • pip install gym
  • pip install 'gym[atari]'
  • invoke vcXsrv Window (I recommend to reboot PC before it)
  • run export DISPLAY=:0
  • run below script, Invaders works fine.
import gym


if __name__ == "__main__":
    env = gym.make("SpaceInvaders-v0")
    env.reset()
    for _ in range(1000):
        env.render()
        env.step(env.action_space.sample())

Invaders

fedorzh

fedorzh commented on Sep 21, 2016

@fedorzh

After multiple hours of trial-and-error, this procedure worked for me from scratch, includes Jupyter:

Install Ubuntu (run in cmd) on Windows:
lxrun /uninstall /all
lxrun /install

Python and Jupyter (reference to microsoft/WSL#185 (comment)):
apt-get update
add-apt-repository ppa:aseering/wsl
apt-get update
apt-get install python-pip ipython ipython-notebook
pip install jupyter
jupyter notebook --no-browser

Gym:
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
pip install gym
pip install 'gym[atari]'

Graphics, I have Intel HD Graphics 4400, launch Xming first (vcXsrv didn't work!):
apt-get install mesa-utils
export DISPLAY=:0

Viliami

Viliami commented on Oct 1, 2016

@Viliami

windows only has 90% market share, it's no big deal...

Viliami

Viliami commented on Oct 2, 2016

@Viliami

I got OpenAI gym to work in windows without BASH but installing the extra dependencies like 'atari' can't be done because they install it using the make command

85 remaining items

ph-dev-2016

ph-dev-2016 commented on Sep 22, 2018

@ph-dev-2016

when trying to use gym I get error from file
gym\wrappers\monitoring\video_recorder.py", line 254, in init
raise error.DependencyNotInstalled("""Found neithethe ffmpeg nor avconv executables.

Is this because
elif distutils.spawn.find_executable('ffmpeg')
should look for ffmpeg.exe in Windows version?

ghost
itegmark

itegmark commented on Apr 8, 2019

@itegmark
NicoEssi

NicoEssi commented on Jun 19, 2019

@NicoEssi

Any update on how the Windows support is coming along? Been years now.

daniel-fudge

daniel-fudge commented on Sep 2, 2019

@daniel-fudge

Just ran successfully in Windows 10. Just follow the readme with the addition of installing the "Build Tools for Visual Studio 2019" from the following site.

https://visualstudio.microsoft.com/downloads/
image

I also found this by reading the following article.
https://towardsdatascience.com/how-to-install-openai-gym-in-a-windows-environment-338969e24d30

I think if the readme was updated with this reference, this issue could be closed.

leemorris

leemorris commented on Jan 12, 2020

@leemorris

@jamartinh - I needed to edit a file after installing Swig from here.

https://github.com/pybox2d/pybox2d/issues/106#issuecomment-535283336

jkterry1

jkterry1 commented on Jul 30, 2021

@jkterry1
Collaborator

I will accept PRs from the community for this, but almost everything should work for Windows and me and those helping maintain Gym don't have the ability to deal extend Gym to Windows ourselves. I'm going to close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gdb@tlbtlbtlb@christopherhesse@ViktorM@andrewssobral

        Issue actions

          Windows support · Issue #11 · openai/gym