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.87k stars 815 forks source link

GL/osmesa.h: No such file or directory #650

Open GoingMyWay opened 2 years ago

GoingMyWay commented 2 years ago

On anaconda, how can I install GL/osmesa.h with conda? I cannot use sudo and the system is red-hat. This issue https://github.com/ethz-asl/reinmav-gym/issues/35 suggested to use sudo to install but I have no right to use sudo.

wookayin commented 2 years ago

Installing OSmesa on a conda will be very tricky. Getting sudo will be a less-painful solution for you. I think installing osmesa locally is outside the scope of mujoco-py, but if you really want to give a try, follow the instructions at https://docs.mesa3d.org/download.html and https://docs.mesa3d.org/install.html

What you'll need to add is to add --prefix=$CONDA_PREFIX (e.g. --prefix=/home/user/miniconda3/envs/your_virtual_env) (or --prefix=$HOME/.local/bin). This will also assume that your LDLIBRARY_PATH, C_INCLUDE_PATH, etc. are also configured accordingly.

Another reference: https://gist.github.com/SiyuanQi/600d1ce536791b7a3bd2e59fdbe69e66

dmklee commented 2 years ago

Try my suggestion from #635, you can install GL/osmesa.h using conda install -c menpo osmesa. Then, set the environment variable C_INCLUDE_PATH=:$HOME/.conda/envs/<env-name>/include when you import mujoco_py the first time.