huangeddie / GymGo

An environment of the board game Go using OpenAI's Gym API
164 stars 31 forks source link

Pyglet usage of deprecated API #4

Closed joaosferreira closed 4 years ago

joaosferreira commented 4 years ago

Hi, hope you are doing well.

Problem

I tried to run demo.py and got the following error:

module 'pyglet.window' has no attribute 'get_platform'

Which comes from this line: https://github.com/aigagror/GymGo/blob/8e97ecf4b52213a1393fc3ce0e2e0c72d379e4fe/gym_go/envs/go_env.py#L184 I seems that pyglet.window.get_platform() and pyglet.platform.get_default_display() are deprecated and were removed.

Possible Solution

I replaced the above line with this:

screen = pyglet.canvas.get_display().get_default_screen()

Doing this fix allowed me to run demo.py successfully.

Environment Information

huangeddie commented 4 years ago

Thank you for bringing it up! I used your solution!

huangeddie commented 4 years ago

I also updated the demo a little bit too