i've installed the OpenGL and the nessecery libs, but when i run the first example CartPole, the function render goes wrong like the following:
Traceback (most recent call last):
File "gymtest.py", line 5, in
env.render()
File "/home/pi/Documents/Reinforcement_Learning/reinforcement-learning-master/Introduction/gym/gym/core.py", line 233, in render
return self.env.render(mode, *kwargs)
File "/home/pi/Documents/Reinforcement_Learning/reinforcement-learning-master/Introduction/gym/gym/envs/classic_control/cartpole.py", line 150, in render
from gym.envs.classic_control import rendering
File "/home/pi/Documents/Reinforcement_Learning/reinforcement-learning-master/Introduction/gym/gym/envs/classic_control/rendering.py", line 27, in
from pyglet.gl import *
File "/usr/local/lib/python3.7/dist-packages/pyglet/gl/__init__.py", line 236, in
import pyglet.window
File "/usr/local/lib/python3.7/dist-packages/pyglet/window/__init__.py", line 1816, in
gl._create_shadow_window()
File "/usr/local/lib/python3.7/dist-packages/pyglet/gl/__init__.py", line 205, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "/usr/local/lib/python3.7/dist-packages/pyglet/window/xlib/__init__.py", line 163, in __init__
super(XlibWindow, self).__init__(
File "/usr/local/lib/python3.7/dist-packages/pyglet/window/__init__.py", line 558, in __init__
self._create()
File "/usr/local/lib/python3.7/dist-packages/pyglet/window/xlib/__init__.py", line 261, in _create
self.context.set_vsync(self._vsync) # XXX ?
File "/usr/local/lib/python3.7/dist-packages/pyglet/gl/xlib.py", line 228, in set_vsync
glxext_mesa.glXSwapIntervalMESA(interval)
File "/usr/local/lib/python3.7/dist-packages/pyglet/gl/lib.py", line 62, in MissingFunction
raise MissingFunctionException(name, requires, suggestions)
pyglet.gl.lib.MissingFunctionException: glXSwapIntervalMESA is not exported by the available OpenGL driver. MESA_swap_control is required for this functionality.
Are you able to run glxgears? This seems like a not good mesa driver, could you try using the newest mesa driver as well?
Changing line ~/virtualenvs/env/lib/python3.7/site-packages/pyglet/gl/xlib.py:209:
self._have_MESA_swap_control = config.glx_info.have_extension('GLX_MESA_swap_control')
to
self._have_MESA_swap_control = config.glx_info.have_extension('GLX_EXT_swap_control')
did the trick for me on Raspberry Pi 4B
Credit goes to: https://www.mail-archive.com/[email protected]/msg11146.html
Most helpful comment
Changing line ~/virtualenvs/env/lib/python3.7/site-packages/pyglet/gl/xlib.py:209:
self._have_MESA_swap_control = config.glx_info.have_extension('GLX_MESA_swap_control')to
self._have_MESA_swap_control = config.glx_info.have_extension('GLX_EXT_swap_control')did the trick for me on Raspberry Pi 4B
Credit goes to: https://www.mail-archive.com/[email protected]/msg11146.html