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

[Question] glGetError #128

Open
3 tasks done
FrankSinatral opened this issue Nov 4, 2024 · 1 comment
Open
3 tasks done

[Question] glGetError #128

FrankSinatral opened this issue Nov 4, 2024 · 1 comment
Labels
question Further information is requested

Comments

@FrankSinatral
Copy link

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-opengland I am using Ubuntu 22.04, I am wondering how should I solve the problem, thanks~

@FrankSinatral FrankSinatral added the question Further information is requested label Nov 4, 2024
@muchvo
Copy link
Collaborator

muchvo commented Nov 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants