You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your work, when I run the example code, I encounter the following error Traceback (most recent call last): File "examples/env_test.py", line 1, in <module> import safety_gymnasium File "/home/fank/Documents/safety-gymnasium/safety_gymnasium/__init__.py", line 19, in <module> from gymnasium import make as gymnasium_make File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/__init__.py", line 12, in <module> from gymnasium.envs.registration import ( File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/envs/__init__.py", line 382, in <module> load_plugin_envs() File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/envs/registration.py", line 600, in load_plugin_envs fn = plugin.load() File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/importlib_metadata/__init__.py", line 189, in load module = import_module(match.group('module')) File "/home/fank/.conda/envs/safegym/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium_robotics/__init__.py", line 5, in <module> from gymnasium_robotics.envs.maze import maps File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium_robotics/envs/maze/__init__.py", line 1, in <module> from gymnasium_robotics.envs.maze.ant_maze import AntMazeEnv File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium_robotics/envs/maze/ant_maze.py", line 20, in <module> from gymnasium.envs.mujoco.ant_v4 import AntEnv File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/envs/mujoco/__init__.py", line 1, in <module> from gymnasium.envs.mujoco.mujoco_env import MujocoEnv, MuJocoPyEnv # isort:skip File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/envs/mujoco/mujoco_env.py", line 19, in <module> import mujoco File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/mujoco/__init__.py", line 47, in <module> from mujoco.gl_context import * File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/mujoco/gl_context.py", line 38, in <module> from mujoco.osmesa import GLContext as _GLContext File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/mujoco/osmesa/__init__.py", line 31, in <module> from OpenGL import GL File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/OpenGL/GL/__init__.py", line 4, in <module> from OpenGL.GL.VERSION.GL_1_1 import * File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in <module> from OpenGL.raw.GL.VERSION.GL_1_1 import * File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in <module> from OpenGL.raw.GL import _errors File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/OpenGL/raw/GL/_errors.py", line 4, in <module> _error_checker = _ErrorChecker( _p, _p.GL.glGetError ) AttributeError: 'NoneType' object has no attribute 'glGetError', this error is induced when running the code import safe-gymnasium, I do alll the codes includingecho "export MUJOCO_GL=osmesa" >> ~/.bashrc source ~/.bashrc apt-get install libosmesa6-dev apt-get install python3-opengland I am using Ubuntu 22.04, I am wondering how should I solve the problem, thanks~
The text was updated successfully, but these errors were encountered:
It appears the issue might be related to MuJoCo's rendering dependencies. I found several similar issues on Google. Have you tried any of the suggested solutions there? As a last resort, you might refer to this Colab notebook; I’ve just tested it, and the environment there still renders correctly. It could be helpful as a reference.
Required prerequisites
Questions
Thanks for your work, when I run the example code, I encounter the following error
Traceback (most recent call last): File "examples/env_test.py", line 1, in <module> import safety_gymnasium File "/home/fank/Documents/safety-gymnasium/safety_gymnasium/__init__.py", line 19, in <module> from gymnasium import make as gymnasium_make File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/__init__.py", line 12, in <module> from gymnasium.envs.registration import ( File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/envs/__init__.py", line 382, in <module> load_plugin_envs() File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/envs/registration.py", line 600, in load_plugin_envs fn = plugin.load() File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/importlib_metadata/__init__.py", line 189, in load module = import_module(match.group('module')) File "/home/fank/.conda/envs/safegym/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium_robotics/__init__.py", line 5, in <module> from gymnasium_robotics.envs.maze import maps File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium_robotics/envs/maze/__init__.py", line 1, in <module> from gymnasium_robotics.envs.maze.ant_maze import AntMazeEnv File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium_robotics/envs/maze/ant_maze.py", line 20, in <module> from gymnasium.envs.mujoco.ant_v4 import AntEnv File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/envs/mujoco/__init__.py", line 1, in <module> from gymnasium.envs.mujoco.mujoco_env import MujocoEnv, MuJocoPyEnv # isort:skip File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/gymnasium/envs/mujoco/mujoco_env.py", line 19, in <module> import mujoco File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/mujoco/__init__.py", line 47, in <module> from mujoco.gl_context import * File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/mujoco/gl_context.py", line 38, in <module> from mujoco.osmesa import GLContext as _GLContext File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/mujoco/osmesa/__init__.py", line 31, in <module> from OpenGL import GL File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/OpenGL/GL/__init__.py", line 4, in <module> from OpenGL.GL.VERSION.GL_1_1 import * File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in <module> from OpenGL.raw.GL.VERSION.GL_1_1 import * File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in <module> from OpenGL.raw.GL import _errors File "/home/fank/.conda/envs/safegym/lib/python3.8/site-packages/OpenGL/raw/GL/_errors.py", line 4, in <module> _error_checker = _ErrorChecker( _p, _p.GL.glGetError ) AttributeError: 'NoneType' object has no attribute 'glGetError'
, this error is induced when running the code import safe-gymnasium, I do alll the codes includingecho "export MUJOCO_GL=osmesa" >> ~/.bashrc source ~/.bashrc apt-get install libosmesa6-dev apt-get install python3-opengl
and I am using Ubuntu 22.04, I am wondering how should I solve the problem, thanks~The text was updated successfully, but these errors were encountered: