Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering issue under windows: pyglet must be updated #53

Closed
aiAdrian opened this issue Oct 27, 2023 · 3 comments · Fixed by #57
Closed

Rendering issue under windows: pyglet must be updated #53

aiAdrian opened this issue Oct 27, 2023 · 3 comments · Fixed by #57
Labels
bug Something isn't working

Comments

@aiAdrian
Copy link
Contributor

Description
Flatland 4.0.0 doesn't work under Windows with python 3.8< due of a pyglet 1.3.2 issue
mmatl/pyrender#95

To Reproduce
List the steps needed to reproduce the behavior:

Windows:

  1. conda create python=3.8 --name flatland_4_0_0
  2. conda activate flatland_4_0_0
  3. python custom_railmap_example.py

Tracer
Traceback (most recent call last):
File "custom_railmap_example.py", line 129, in
main(sys.argv[1:])
File "custom_railmap_example.py", line 122, in main
custom_railmap_example(sleep_for_animation, do_rendering)
File "custom_railmap_example.py", line 95, in custom_railmap_example
env_renderer.render_env(show=True, show_observations=False)
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\flatland\utils\rendertools.py", line 62, in render_env
return self.renderer.render_env(show, show_agents, show_inactive_agents, show_observations,
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\flatland\utils\rendertools.py", line 526, in render_env
return self.render_env_svg(show=show,
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\flatland\utils\rendertools.py", line 761, in render_env_svg
self.gl.show()
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\flatland\utils\graphics_pgl.py", line 56, in show
self.open_window()
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\flatland\utils\graphics_pgl.py", line 24, in open_window
self.window = pgl.window.Window(resizable=True, vsync=False, width=1200, height=800)
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet_init_.py", line 384, in getattr
import(import_name)
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\window_init_.py", line 1896, in
gl.create_shadow_window()
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\gl_init
.py", line 208, in create_shadow_window
shadow_window = Window(width=1, height=1, visible=False)
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\window\win32_init
.py", line 134, in init
super(Win32Window, self).init(*args, **kwargs)
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\window_init
.py", line 501, in init
display = get_platform().get_default_display()
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\window_init_.py", line 1845, in get_default_display
return pyglet.canvas.get_display()
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\canvas_init_.py", line 77, in get_display
from pyglet.app import displays
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\app_init_.py", line 175, in
event_loop = EventLoop()
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\app\base.py", line 119, in init
self.clock = clock.get_default()
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet_init_.py", line 384, in getattr
import(import_name)
File "C:\Users\u216993\AppData\Local\miniconda3\envs\flatland_4_0_0\lib\site-packages\pyglet\clock.py", line 166, in
_default_time_function = time.clock
A

@aiAdrian aiAdrian added the bug Something isn't working label Oct 27, 2023
@aiAdrian
Copy link
Contributor Author

aiAdrian commented Oct 27, 2023

(flatland_4_0_0) C:\devsbb\workspace\flatland\flatland-rl\examples>pip install pyglet -U
Requirement already satisfied: pyglet in c:\users\u216993\appdata\local\miniconda3\envs\flatland_4_0_0\lib\site-packages (1.3.2)
Collecting pyglet
Using cached pyglet-2.0.9-py3-none-any.whl.metadata (8.4 kB)
Downloading pyglet-2.0.9-py3-none-any.whl (854 kB)
---------------------------------------- 854.7/854.7 kB 2.0 MB/s eta 0:00:00
Installing collected packages: pyglet
Attempting uninstall: pyglet
Found existing installation: pyglet 1.3.2
Uninstalling pyglet-1.3.2:
Successfully uninstalled pyglet-1.3.2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gym 0.14.0 requires pyglet<=1.3.2,>=1.2.0, but you have pyglet 2.0.9 which is incompatible.
Successfully installed pyglet-2.0.9

@aiAdrian aiAdrian changed the title pyglet must be updated Rendering issue under windows: pyglet must be updated Oct 27, 2023
@aiAdrian aiAdrian linked a pull request Oct 27, 2023 that will close this issue
6 tasks
@fnberta
Copy link
Contributor

fnberta commented Oct 27, 2023

Ok, so the culprit here is that we currently pin gym to version 0.14.0 which then depends on an old version of pyglet. I tried to update gym in #55, but only partly succeeded. Please see the PR for more info.

Also, tackling #26 would really simplify resolving this issue. Is this something that could be done rather quickly?

@fnberta
Copy link
Contributor

fnberta commented Oct 29, 2023

Thanks to your work in #56, we can fix this in #57.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants