PacktPublishing / Deep-Reinforcement-Learning-Hands-On

Hands-on Deep Reinforcement Learning, published by Packt
MIT License
2.83k stars 1.29k forks source link

monitor not working in Chapter04/01_cartpole.py #3

Closed lqiang2003cn closed 5 years ago

lqiang2003cn commented 6 years ago

i umcommented the line 79 in the Chapter04/01_cartpole.py to record video: env = gym.wrappers.Monitor(env, directory="mon", force=True)

however, when the program terminates, it throws the following exception:

Exception ignored in: <bound method Viewer.del of <gym.envs.classic_control.rendering.Viewer object at 0x000000000507DA58>> Traceback (most recent call last): File "E:\dlsoft\lib\site-packages\gym\envs\classic_control\rendering.py", line 143, in del File "E:\dlsoft\lib\site-packages\gym\envs\classic_control\rendering.py", line 62, in close File "E:\dlsoft\lib\site-packages\pyglet\window\win32__init.py", line 305, in close File "E:\dlsoft\lib\site-packages\pyglet\window\init__.py", line 770, in close ImportError: sys.meta_path is None, Python is likely shutting down

i'm working on windows in Anaconda, Any ideas ? thanks !

Shmuma commented 5 years ago

Hi!

OpenAI gym is not supporting windows officially: https://github.com/openai/gym/issues/11

Some environments might work, but weird behaviour could pop up here and there. That was the reason why in chapter2, section "Hardware and software requirements" it was stated that only linux and mac os is supported by examples.

To solve this issue I'd suggest you to install ubuntu in virtual machine or use cloud instance.

lqiang2003cn commented 5 years ago

all right , thanks anyway.