openai / mujoco-py

MuJoCo is a physics engine for detailed, efficient rigid body simulations with contacts. mujoco-py allows using MuJoCo from Python 3.
Other
2.81k stars 810 forks source link

fatal error: GL/glew.h: No such file or directory 4 | #include <GL/glew.h> #745

Open qinmoelei opened 1 year ago

qinmoelei commented 1 year ago

My python version is 3.8.5 My problem is that after I have installed the mujoco and try it using the following code

import os
import mujoco_py
print(os.environ.get("LD_LIBRARY_PATH", ""))
mj_path = mujoco_py.utils.discover_mujoco()
xml_path = os.path.join(mj_path, 'model', 'humanoid.xml')
model = mujoco_py.load_model_from_path(xml_path)
sim = mujoco_py.MjSim(model)

print(sim.data.qpos)

The following error occurs

 fatal error: GL/glew.h: No such file or directory
    4 | #include <GL/glew.h>
      |          ^~~~~~~~~~~
compilation terminated.

The problem is that I do not have the root authority to use the command

sudo apt-get install libglew-dev

What should I do?

Kelym commented 1 year ago

You can follow #627

238Ver commented 1 year ago

The command works for me. Thx

02WYF23 commented 3 months ago

I solved this issue with conda. sudo apt install ligblew-dev

clerdson commented 3 months ago

c++ suports path include

include </Users/clerdson/Desktop/glew/include/GL/glew.h>