Comments (101)
windows only has 90% market share, it's no big deal...
from gym.
Thank you all. Here I try to summarize the method of installing the complete OpenAI Gym on Windows without using WSL, for future reference.
How to install the complete OpenAI Gym on Windows without using WSL
The following procedure has been tested on both Windows 7 and Windows 10.
-
Install newest Miniconda:
From here: https://conda.io/miniconda.html. I strongly recommend Python 3.6. Note: Remember to select the add to Path in installation. -
Install a newest Windows C++ compiler if you don't have one:
For the list of compilers, see here: https://wiki.python.org/moin/WindowsCompilers. For Python 3.6, I strongly recommend Microsoft Build Tools for Visual Studio 2017. Note: Remember to select the Visual C++ build tools with default setting in installation. It will take more than 5 GB on system drive :-) -
Install MuJoCo 1.50:
According to https://github.com/openai/mujoco-py: You should obtain a 30-day free trial on the MuJoCo website (https://www.roboti.us/license.html) or one-year free license if you are a student. The license key will arrive in an email with your username and password. Download the MuJoCo 1.50 binaries for Windows (https://www.roboti.us/). Unzip the downloadedmjpro150
folder at%USERPROFILE%\.mujoco\mjpro150
, and place your license key (themjkey.txt
file from your email) at%USERPROFILE%\.mujoco\mjkey.txt
. (%USERPROFILE%
is your user folder on system drive, likeC:\Users\OpenAI
.) -
Install complete OpenAI Gym in Command Prompt:
conda install git
conda install -c conda-forge ffmpeg
# Note: For video recording.
conda update --all
conda clean -a
pip install git+https://github.com/Kojoley/atari-py.git
pip install gym[all]
# Get all things done!
Note: If you are using a non-English version of Windows and get UnicodeDecodeError
, see this solution: pypa/pip#4251 (comment).
from gym.
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:
- Update to the latest version of Windows (>version 1607, "Anniversary Update")
- Enable Windows Subsystem for Linux (WSL)
- Open cmd, run bash
- 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.
- Install vcXsrv, and run it (you should just have a little tray icon)
- 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.
- Get the drivers: "sudo apt-get install nvidia-319 nvidia-settings-319 nvidia-prime"
- Run!
Let me know if you have any questions or if I should do a detailed guide.
from gym.
@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())
from gym.
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.
from gym.
@bshishov You can simply type pip install --no-index -f https://github.com/Kojoley/atari-py/releases atari_py
and press enter. That's all. Pip will download the right wheel and install it automatically.
from gym.
Let me say that given the OpenAI mission (and the reasons behind the gym toolkit) the lack of official support for the most widespread OS on the planet is pretty puzzling.
from gym.
I got rid of zlib depency completely, so except the need of compiler it is now simply as typing pip install -U git+https://github.com/Kojoley/atari-py.git
from gym.
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
from gym.
I've gotten atari_py to build and install on Windows 7 x86_64, using msys2/mingw64 for the compiler tools, Python 3.5 Anaconda, Xming for graphics, and TensorFlow 0.12.0 + CUDA GPU enabled.
For simplicity, I've forked this project with relatively minor changes applied and full install instructions included: https://github.com/rybskej/atari-py
It should be possible to merge these changes back into this project, with minor edits. I'll try to work on a portable patch.
from gym.
True
from gym.
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.
from gym.
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
from gym.
Thanks for the package and instructions! I installed gym and atari environments on Windows 10 + Anaconda 3 with no problems using
pip install gym
pip install git+https://github.com/Kojoley/atari-py.git
and everything seems to work well. Atari-py only required git and Microsoft Visual C++ Build Tools.
from gym.
Hello,
Using the latest version of WinPython 3.5 (http://winpython.github.io/) on Windows 10, gym and atari installed drama-free using pip.
I ran the following two commands inside my python environment.
- pip install gym
- pip install git+https://github.com/Kojoley/atari-py.git
As a bonus, the latest versions of sk-learn, tensorflow, numpy, etc also work perfectly.
Hope this helps!
from gym.
Yep, definitely!
from gym.
@jamartinh , I found the same error with Box2D-kengz while installing Box2d on Windows 10. I just went to http://www.swig.org/download.html, downloaded the zip file, unzipped it, changed windows PATH environmental to include swig.exe, then installed Box2D again and it seems to be working:
import gym
env = gym.make('LunarLander-v2')
env.reset()
for _ in range(1000):
env.render()
env.step(env.action_space.sample())
from gym.
For everyone who is interested in windows binaries https://github.com/Kojoley/atari-py/releases
from gym.
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.
from gym.
Was able to get VcXsrv to work with Bash on Windows 10 (Dell Latitude 6220), python 2.7.6 by install the
opengl library:
- sudo apt-get install python-opengl
- export DISPLAY=:0
- run the cart pole example from gym or other games
Best of luck.
from gym.
I have opend a PR openai/atari-py#7 but I am asking here for help in testing it out.
All you need is to enter pip install -U git+https://github.com/Kojoley/atari-py.git
(requires zlib
so have one installed in your system, the path to it can be provided with ZLIB_ROOT
environment variable)
from gym.
from gym.
Windows 10, Anaconda , pip install
I am currently using OpenAI gym with Pycharm IDE. You can download Anaconda which is available for windows and install tensorflow and gym by following prescribed pip install procedure.
from gym.
I'm running Python 3.6.1 with Conda 4.3.25 on Windows 10 and I did
pip install gym
in an Anaconda prompt.
I'm able to run the CartPole example this page: https://gym.openai.com/docs/
but the rendering is extremely slow. It is much slower than if I ran the same thing on a Mac, or on Windows with a native pip install outside Anaconda. If I remove "env.render()", then it appears to run reasonably fast. The pop-up video that appears seem to be rendered via some kind of IPython window. Has anyone else encountered this issue and know a way to speed up rendering?
from gym.
Greetings, What is the long range strategy for windows support?
Please consider adding support for windows installation via pip.
Thanks, coast
from gym.
This instruction worked like charm: https://towardsdatascience.com/how-to-install-openai-gym-in-a-windows-environment-338969e24d30
from gym.
@lunzueta I knew it was a safe version for working with vcXsrv, I would imagine newer versions work.
from gym.
@Viliami Could you give detail on how you got OpenAI gym working without BASH?
from gym.
@rybskej you are my hero! I followed your instructions in https://github.com/rybskej/atari-py and I can finally render Atari games in Windows 10 (no WSL bash): python 3.5 Anaconda, Xming, TensorFlow 0.12.0 + CUDA GPU and PyCharm :) It would be very interesting to merge the changes back, since many more people could benefit from it.
I also tested Ubuntu bash under Windows 10 WSL following @icoxfog417 instructions and it works using Xming, as suggested by @fedorzh.
from gym.
@Kojoley Just to clarify, what are the prerequisites for installing ALE using pip install
git+https://github.com/Kojoley/atari-py.git
? Do I need MSYS2? a C++ compiler? a certain version of Python?
Yes, a C++ compiler is required. https://wiki.python.org/moin/WindowsCompilers
I was able to install on Anaconda at some point, but after reinstalling anaconda with python 3.6 I'm running into a fatal error: cannot run rc.exe
Install mingw with anaconda if you do not have MSVC, it should automatically configure your distutils.cfg
to use it.
from gym.
@jamartinh , I faced the same issue and apparently get resolved when following instructions at https://github.com/j8lp/atari-py.
from gym.
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.
from gym.
Any update on this?
from gym.
@maxosmith Good news! I have one question about this: why nvidia-319 and not a newer version?
from gym.
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.
from gym.
It's fascinating that I haven't been able to run even the cartpole on either a fresh install of the latest ubuntu on the hardware or in a vm, but the whole "ubuntu on windows" thing work flawlessly after the first try... :D thanks for the setup instructions @maxosmith @icoxfog417 !
from gym.
from gym.
@rybskej Crystal clear instructions and it just works! Thanks a lot! Win7 x64, python 3.5
from gym.
@Kojoley
Win7_x64: I installed zlib from here Set ZLIB_ROOT to installation directory. But compiler could not find zlib.h. If i change ZLIB_ROOT to INSTALL_DIR/include it could not link...
from gym.
@edupard I have pushed a fix, but I am afraid that package you have provided link to is suitable only for mingw/cygwin (it requires unistd.h
which is the part of posix that msvc does not support)
from gym.
@Kojoley Can you please tell exact package i have to use?
from gym.
@edupard If you use mingw as compiler for python - you can use one you have provided. Otherwise you have to compile it by yourself from official site. (I have not done conda support yet)
from gym.
@rybskej and others, I found the method of @rybskej simpler than any other.
I works nicely. Also, it seems to render on windows 10 without the need of xming.
from gym.
@rybskej I was initially having problems building with make
(something about not being able to find the compiler) but I tried again after reinstalling python and msys2 numerous times. It works beautifully! Thank you.
Running Windows 10 Insider Preview, Surface Book with dGPU, and Anaconda 4.2.0 with Python 3.5.2
from gym.
@davidtellez I have installed Xming and msys64 already, however I don't know what to do next, because I didn't know how to use Xming, would you like to tell me some more details, please? I was trapped at the step 4, thank you very much.
from gym.
@emodark If you use the msys64 build system you don't need Xming, things will be rendered naturally on Windows.
Just install, pip install git+https://github.com/Kojoley/atari-py.git from the msys console and you should be done.
from gym.
@davidtellez @rybskej Thanks for your help in getting this to work. The only issue I'm having at the moment is getting it to work in PyCharm. Everything appears to work when I run from Command Prompt but only CartPole works when I run a script from PyCharm.
Did you experience any problems?
from gym.
@WillPalmer21 If you are using mingw as your compiler you might forget that mingw dll's have to be on your PATH
environment variable (libgcc_s_dw2-1.dll
, libstdc++-6.dll
and others). Possible solutions are: 1) compile with msvc 2) add path to mingw on pycharm under run configuration dialog
from gym.
@Kojoley I had followed the instructions given by rysbskej 3) Append to current Windows User PATH: ";C:\msys64\mingw64\bin;C:\msys64\usr\bin"
but I guess I needed to add this in pycharm as well. Seems to be working now thanks!
from gym.
@WillPalmer21 This is an offtopic question. Open a new issue. From the error message: you might want to check if pyglet
is installed.
from gym.
@Kojoley Ok, apologies, I will delete my comment and open a new issue. I checked and it is installed, hence my confusion.
from gym.
@rybskej , @jamartinh or @edupard i was trying the @rybskej suggested method, but I am unsure if I am doing it correctly. Since you guys have it running could anyone of you please help to get this resolved? (I wish to install atari on anaconda)
I have gym installed successfully with pip install gym
on windows 10.
Also as suggested on https://github.com/rybskej/atari-py I followed all the steps. Installed MSYS2 and all packages and all went smooth upto step 4.
But on step 5, when I was trying to do it in cmd, i clones the repo run make
command, i get this error...
make -C atari_py/ale_interface build
make[1]: Entering directory `D:/ucl/Advance Topics in Machine Learning/Assignements/Assignment 3/atari-py/atari_py/ale_interface'
mkdir -p build && cd build && cmake -G "MSYS Makefiles" .. && make -j4
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-6.3.0-posix-seh-rt_v5-rev1/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-6.3.0-posix-seh-rt_v5-rev1/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files/mingw-w64/x86_64-6.3.0-posix-seh-rt_v5-rev1/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/Program Files/mingw-w64/x86_64-6.3.0-posix-seh-rt_v5-rev1/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/ucl/Advance Topics in Machine Learning/Assignements/Assignment 3/atari-py/atari_py/ale_interface/build
make[2]: Entering directory `D:/ucl/Advance Topics in Machine Learning/Assignements/Assignment 3/atari-py/atari_py/ale_interface/build'
/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `C:/Program Files (x86)/GnuWin32/bin/make -f CMakeFiles/Makefile2 all'
make[2]: *** [all] Error 1
make[2]: Leaving directory `D:/ucl/Advance Topics in Machine Learning/Assignements/Assignment 3/atari-py/atari_py/ale_interface/build'
make[1]: *** [build] Error 2
make[1]: Leaving directory `D:/ucl/Advance Topics in Machine Learning/Assignements/Assignment 3/atari-py/atari_py/ale_interface'
make: *** [build] Error 2
from gym.
It's choking on the parenthesis in the name of the directory of the Make program.
To build Linux projects on Windows, it's best if all your files are in directories with only letters and numbers in the names.
from gym.
@tlbtlbtlb Thank you so much for the quick reply. And yes that was exactly the issue. Setup worked fine now.
Sorry, I am not much aware on linux projects side.
Also thanks @rybskej for the github page on atari setup.
from gym.
@rybskej , @jamartinh ,@tlbtlbtlb @edupard i was trying the @rybskej suggested method, but I am unsure if I am doing it correctly. I was trying to do the same as NitishMutha but ran into different problems. I was wondering if I could get a pointer as to where I might be going wrong? (I also wish to install on anaconda).
I have gym installed successfully with pip install gym on windows 10.
Also as suggested on https://github.com/rybskej/atari-py I followed all the steps. Installed MSYS2 and all packages and all went smooth upto step 4.
But on step 5, when I was trying to do it in cmd, I cloned the repository and run cd atari-py && make && python setup.py install && pip install "gym[atari]"
command, i get this error...
make -C atari_py/ale_interface build
make[1]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface'
mkdir -p build && cd build && cmake -G "MSYS Makefiles" .. && make -j4
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build
make[2]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[3]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[4]: Entering directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
[ 0%] Building CXX object CMakeFiles/ale-bin.dir/src/common/ScreenExporter.cpp.obj
[ 0%] Building CXX object CMakeFiles/ale-lib.dir/src/common/ScreenExporter.cpp.obj
[ 1%] Building C object CMakeFiles/ale-lib.dir/src/emucore/unzip.c.obj
[ 2%] Building CXX object CMakeFiles/ale-c-lib.dir/src/common/ScreenExporter.cpp.obj
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/common/ScreenExporter.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/* *****************************************************************************
^
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/common/ScreenExporter.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/* *****************************************************************************
^
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/common/ScreenExporter.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/* *****************************************************************************
^
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/emucore/unzip.c:11:18: fatal error: zlib.h: No such file or directory
compilation terminated.
make[4]: *** [CMakeFiles/ale-lib.dir/build.make:375: CMakeFiles/ale-lib.dir/src/emucore/unzip.c.obj] Error 1
make[4]: *** Waiting for unfinished jobs....
[ 2%] Building CXX object CMakeFiles/ale-bin.dir/src/controllers/rlglue_controller.cpp.obj
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/controllers/rlglue_controller.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/* *****************************************************************************
^
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/common/ScreenExporter.cpp:18:18: fatal error: zlib.h: No such file or directory
compilation terminated.
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/common/ScreenExporter.cpp:18:18: fatal error: zlib.h: No such file or directory
compilation terminated.
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/common/ScreenExporter.cpp:18:18: fatal error: zlib.h: No such file or directory
compilation terminated.
make[4]: *** [CMakeFiles/ale-c-lib.dir/build.make:207: CMakeFiles/ale-c-lib.dir/src/common/ScreenExporter.cpp.obj] Error 1
make[4]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[3]: *** [CMakeFiles/Makefile2:142: CMakeFiles/ale-c-lib.dir/all] Error 2
make[3]: *** Waiting for unfinished jobs....
make[4]: *** [CMakeFiles/ale-bin.dir/build.make:207: CMakeFiles/ale-bin.dir/src/common/ScreenExporter.cpp.obj] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [CMakeFiles/ale-lib.dir/build.make:183: CMakeFiles/ale-lib.dir/src/common/ScreenExporter.cpp.obj] Error 1
make[4]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[3]: *** [CMakeFiles/Makefile2:68: CMakeFiles/ale-lib.dir/all] Error 2
[ 2%] Building C object CMakeFiles/ale-bin.dir/src/emucore/unzip.c.obj
C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/src/emucore/unzip.c:11:18: fatal error: zlib.h: No such file or directory
compilation terminated.
make[4]: *** [CMakeFiles/ale-bin.dir/build.make:399: CMakeFiles/ale-bin.dir/src/emucore/unzip.c.obj] Error 1
make[4]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[3]: *** [CMakeFiles/Makefile2:105: CMakeFiles/ale-bin.dir/all] Error 2
make[3]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[2]: *** [Makefile:84: all] Error 2
make[2]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface/build'
make[1]: *** [Makefile:4: build] Error 2
make[1]: Leaving directory 'C:/Users/Alex/gym/Assignment_3/atari-py/atari_py/ale_interface'
make: *** [Makefile:4: build] Error 2
Any feedback would be greatly appreciated!!
from gym.
from gym.
@jamartinh Thank you for the quick response.
I did what you suggested and I get the same fatal error that zlib.h is not found even though I've added it to the path. Although it now builds 6% rather than 2%. I have zlib.h installed in my environment so I am unsure as what to do.
The problem occurs when I use make, even though I believe I installed it correctly as per instructed .
from gym.
I am using Windows 7 & and have Anaconda and Python 3.5 installed. I used "pip install gym" and it installed the packages 'pyglet' and 'gym-0.8.1'. I tried the demo program on gym.openai.com/docs and it worked. I don't understand how I could install it with just a pip command. According the GitHub repository for gym it is only supported for Linux and OS X. Any thoughts?
from gym.
Using @rybskej solution, on step 5 I get the following error:
$ cd atari-py && make && python setup.py install && pip install "gym[atari]"
0 [main] make 508 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report this problem to
the public mailing list [email protected]
make -C atari_py/ale_interface build
make[1]: Entering directory /cygdrive/c/Users/marct_000/atari-py/atari-py/atari_py/ale_interface' mkdir -p build && cd build && cmake -G "MSYS Makefiles" .. && make -j4 make[1]: /bin/sh: Command not found Makefile:4: recipe for target
build' failed
make[1]: *** [build] Error 127
make[1]: Leaving directory /cygdrive/c/Users/marct_000/atari-py/atari-py/atari_py/ale_interface' Makefile:4: recipe for target
build' failed
make: *** [build] Error 2
I'm using Windows 10. Any help with this would greatly be appreciated.
from gym.
from gym.
@jamartinh, I'm not that familiar with MSYS64. When I first installed it, git and make we not valid commands. I had to:
pacman -Su git
pacman -Su cmake
Then I could: make && python setup.py install
But when I run the test on Pong-v0 from a command prompt:
import gym
env = gym.make('Pong-v0')
I get the error: No module named 'atari_py'
from gym.
Hi I need some help. I tried to install gym and atari on Windows (Win8) following the steps suggested by @rybskej. It seemed sucessefully installed.
I can render cart-pole task directly without using Xming. However, when I try to render 'Pong-v0', there is an error 'AttributeError: 'ALEInterface' object has no atribute 'getScreenRGB2'.
I found someone solved this by updating atari version but I can't upgrade it. (using pip install --upgrade atari-py)
My question is that if the problem is due to no update? if yes, is this solution updatable and how can I?
Or could my problem be due to Xming because I just set it as suggested but it did not work?
from gym.
@ulamaca rybskej's version of atari-py has an older version of ALEInterface that does not support the newer getScreenRGB2 function which is used in the updated gym package (the one you then install through pip)
I managed to go around the same error by downgrading the gym package (pip uninstall gym, then pip install -I gym==0.8.1)
0.8.1 was the newest version I found before the getScreenRGB2 function was introduced
Hope that helps
from gym.
Are there any plans of support for simpler installation on Windows 10? Similar to gym install - pip install gym[atari] ?
from gym.
Hey everyone. So I did an automatic merge of rybskej's atari-py windows compatibility repo with the latest version of atari-py, and it seems to work for me on Windows 10. Just clone and follow rybskej's instructions in the README.
https://github.com/j8lp/atari-py
Let me know if it works.
from gym.
@j8lp looks like you forgot to change this line: git clone https://github.com/rybskej/atari-py
in the description. It led to the errors during atari env test run due to the old version. After I changed it to clone you repo it started working: git clone https://github.com/j8lp/atari-py
from gym.
@ViktorM Thanks. Fixed now. The instructions now point to the correct repo
from gym.
@icoxfog417 I try to follow your steps, anyway i got an error when trying to install gym atari;
Failed building wheel for atari-py (then ended up with the error below)
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-DR32yC/atari-py/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n','\n');f.close();exec(compile(code, file, 'exec'))"install --record /tmp/pip-I4jqkz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-DR32yC/atari-py/
Any idea how I should fix this?
Thanks
Nat
from gym.
@edwarner You're a god. Thank you so much! After over 10 hours of trying different methods, this finally worked for me. Question: how do I use this with another IDE, like PyCharm?
EDIT: got it working with PyCharm, but I can't seem to get ffmpeg to work.
from gym.
@Kojoley Just to clarify, what are the prerequisites for installing ALE using pip install git+https://github.com/Kojoley/atari-py.git
? Do I need MSYS2? a C++ compiler? a certain version of Python?
I was able to install on Anaconda at some point, but after reinstalling anaconda with python 3.6 I'm running into a fatal error: cannot run rc.exe
from gym.
Is anyone working on getting the actual openai gym code to support Windows?
from gym.
Hi,
I installed WinPython, then the compiler (Microsoft Visual C++ 14.0 standalone: Build Tools for Visual Studio). Rebooted PC, still getting an error message telling me to install the compiler when I run "pip install git+https://github.com/Kojoley/atari-py.git". I run the CMD as administrator.
Any ideas?
Update:
I had to go here:
http://landinghub.visualstudio.com/visual-cpp-build-tools
and download/install "Visual C++ Build Tools 2015".
from gym.
@trohun Have you selected the Windows 8.1 SDK (and Windows 10 SDK if you on Windows 10) during the Visual C++ 2015 Build Tools install?
from gym.
@Kojoley I just installed the Visual C++ 2015 Build Tools and used the default settings.
from gym.
For those that have OpenAI working on Windows, do the environments from the home page work?
env = gym.make("Taxi-v1")
and env = gym.make("FrozenLake-v0")
don't seem to be working for me.
from gym.
I think the best approach is to get a VM with ubuntu. Thats what I have allowing me to game as program on my PC!
from gym.
@moondra2017 Taxi-v2
and FrozenLake-v0
works for me.
from gym.
@Kojoley Thanks to you, I am able to get atari gyms running. But sometimes the output window goes black while rendering episodes. Do you know the reason?
from gym.
@y2ee201 I am sorry, I did not have such problem.
from gym.
I am a windows 10 (HP PAVILION 15-AB032TX) user, I am new to python and machine learning and all of the above. It would be great if someone could comment replying to me a complete list of to-dos to get open-ai gym, python, tenserflow, etc working on my system.
Assume it's a fresh install of windows (I DONT HAVE ANYTING RELATED TO PYTHON ON MY SYSTEM). I use sublime atm. I need Atari games and be able to run the simulation/ learning stuff on super mario or something similar . I need to be able to run the virtual env. and etc similar to this
I also need Universe to work
from gym.
Windows 7 user also need gym.
from gym.
Thanks @Nikkou !! That worked for me 😄
from gym.
Thanks so much @icoxfog417. The steps you provided help me getting Atari running.
A few note to those trying to follow the instruction:
- Python 3.5 is recommended. Using Python 3.6 would result in having to deal with SSL error when calling pip
- libgcc might have to be installed
from gym.
For those who don't want to compile packages themselves, you can use already built wheel packages for windows (they already have a built ale_c dll inside):
- Simply download one from https://github.com/Kojoley/atari-py/releases (matching your python version and OS arch)
- And run
python -m pip install THE_NAME_OF_THE_FILE_YOU_JUST_DOWNLOADED.whl
Worked for me. Hope it will save some of your time.
from gym.
@Kojoley yeah, sure. That is definitely easier. I was just looking manually for dlls first. Anyway, thank you for publishing these builds.
from gym.
Thanks so much @aywi. I'm running Breakout game on Python 3.6.3 Anaconda.
The rendering is extremely fast 😄
I have just an exception at the end (when the bot lost all of his lives).
Traceback (most recent call last):
File "C:\Tools\Continuum\miniconda3\envs\tensorflow\lib\site-packages\gym\envs\classic_control\rendering.py", line 347, in __del__
File "C:\Tools\Continuum\miniconda3\envs\tensorflow\lib\site-packages\gym\envs\classic_control\rendering.py", line 343, in close
File "C:\Tools\Continuum\miniconda3\envs\tensorflow\lib\site-packages\pyglet\window\win32\__init__.py", line 305, in close
File "C:\Tools\Continuum\miniconda3\envs\tensorflow\lib\site-packages\pyglet\window\__init__.py", line 770, in close
ImportError: sys.meta_path is None, Python is likely shutting down```
from gym.
This was such as useful thread.
from gym.
It seems that pyglet==1.2.4 is required instead of the current 1.3?
from gym.
It seems that pyglet==1.2.4 is required instead of the current 1.3?
If you are talking about this
https://bitbucket.org/pyglet/pyglet/issues/170/nameerror-name-puint-is-not-defined issue --
it is a problem with pyglet==1.3.1
on Python 2.7. You can roll back to pyglet==1.3.0
or install it from trunk.
from gym.
I am on python36, I had to downgrade to pyglet==1.2.4
from gym.
I'm on python 3.6.4 and I got an error when running pip install gym[all]
: Failed building wheel for Box2D-kengz.
Anyone got the same?
from gym.
from gym.
Do you know how to fix it @jamartinh?
I followed @aywi instructions and I could do pip install gym
, but not pip install gym[all]
.
from gym.
from gym.
from gym.
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?
from gym.
I would like to share how I got it working on Windows 10:
First I enabled & installed Windows Subsystem for Linux. I went ahead and installed entire ubuntu-desktop
which was not required I guess. You can also install Xming if you want to enable using GUI's like gedit, firefox (You would need to set Display:0).
Later I installed anaconda followed by pip install gym['atari']
& used jupyter notebook with --no-browser
flag to open it in native Windows chrome browser. It works without any problem for me.
NOTE: I've skipped some things like pip refusing to install gym because of some permission error etc. I resolved it but I think that wasn't a generic error. If anyone is trying and facing any error, do report. I will share the solutions.
from gym.
Any update on how the Windows support is coming along? Been years now.
from gym.
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/
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.
from gym.
@jamartinh - I needed to edit a file after installing Swig from here.
https://github.com/pybox2d/pybox2d/issues/106#issuecomment-535283336
from gym.
Related Issues (20)
- [Bug Report] Getting Error from "D:\PongDQN_RL\venv\lib\site-packages\gym\wrappers\compatibility.py" HOT 12
- [Question] Custom dtype in observation space
- [Bug Report] pusher-v4 in the environment doesn't collide the object for the fork HOT 1
- [Question] How to verify who is the winner of a game? HOT 3
- [bug] OpenAI gym set_level(50) not disabling logs HOT 1
- [Bug Report] Humanoidv4 doesnt include contact_cost in code, but still present in documentation HOT 4
- [Question] I am implementing a DQN on Atari. I have some shape related problems. HOT 1
- [Question] MUJOCO environment info ERROR in the gym documentation website HOT 3
- [Question] How do I edit the leaderboard? HOT 1
- [Question] AsyncVectorEnv getting hung up as `pip.recv()` not returning anything for `_check_observation_spaces` HOT 4
- [Question] Question title
- gym.error.UnregisteredEnv: No registered env with id: meme-v0 HOT 1
- AttributeError: attempted to get missing private attribute '_domain_file' HOT 2
- ModuleNotFoundError: No module named 'gym.envs.atari' HOT 4
- [Bug Report] When call a base64.b64encode() on a Box observation_space, the programme shut down without Error
- Problem in render_mode HOT 1
- Error related to import gym HOT 4
- [bug] EOF error with gym.vector.AsyncVectorEnv() when calling the step method. HOT 1
- trying to use mujoco env
- [Question] Install gym 0.19.0 on google colab. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gym.