macOS "Can't find OpenGL" error - newer version of pyglet needed
Hello, I am getting following error when trying to run flatland builded from the source on macOs Big Sur Version 11.1. I am pretty sure OpenGL is installed. I found that this was a common problem when using older versions of pyglet, but it was repaired in version 1.5.11. However, I cannot use this version, as gym 0.14.0 has requirement for lower versions of this library. Is there any easy fix available for this trouble?
(flatland) Miroslavs-MacBook-Pro:project miroslavmatocha$ flatland-demo
open_window - pyglet
Traceback (most recent call last):
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/__init__.py", line 378, in __getattr__
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'Window'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/__init__.py", line 378, in __getattr__
return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute '_create_shadow_window'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/miroslavmatocha/miniconda3/envs/flatland/bin/flatland-demo", line 33, in <module>
sys.exit(load_entry_point('flatland-rl', 'console_scripts', 'flatland-demo')())
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/cli.py", line 49, in demo
env_renderer.render_env(
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/rendertools.py", line 62, in render_env
return self.renderer.render_env(show, show_agents, show_inactive_agents, show_observations,
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/rendertools.py", line 526, in render_env
return self.render_env_svg(show=show,
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/rendertools.py", line 761, in render_env_svg
self.gl.show()
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/graphics_pgl.py", line 56, in show
self.open_window()
File "/Users/miroslavmatocha/AAU/project/flatland/flatland/utils/graphics_pgl.py", line 24, in open_window
self.window = pgl.window.Window(resizable=True, vsync=False, width=1200, height=800)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/__init__.py", line 384, in __getattr__
__import__(import_name)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/window/__init__.py", line 1896, in <module>
gl._create_shadow_window()
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/__init__.py", line 384, in __getattr__
__import__(import_name)
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/gl/__init__.py", line 100, in <module>
from pyglet.gl.lib import GLException
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/gl/lib.py", line 141, in <module>
from pyglet.gl.lib_agl import link_GL, link_GLU, link_AGL
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/gl/lib_agl.py", line 48, in <module>
gl_lib = pyglet.lib.load_library(
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/lib.py", line 118, in load_library
return self.load_framework(kwargs['framework'])
File "/Users/miroslavmatocha/miniconda3/envs/flatland/lib/python3.9/site-packages/pyglet/lib.py", line 286, in load_framework
raise ImportError("Can't find framework %s." % path)
ImportError: Can't find framework /System/Library/Frameworks/OpenGL.framework.
Edited by miroslav_matocha