mujoco-py icon indicating copy to clipboard operation
mujoco-py copied to clipboard

How to install mujoco-py in a server without root privileges?

Open luckeciano opened this issue 3 years ago • 10 comments

Hello,

I started to use Mujoco in a shared server (Ubuntu 18.04). I would like to install mujoco-py package there, but I don't have root privileged to install dependencies (e.g., I can't execute sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3)

Is there any way to install it without root access?

Thanks!

luckeciano avatar Aug 19 '21 06:08 luckeciano

Did you find a solution to this problem? I am facing the same issue.

PierreBoyeau avatar Sep 01 '21 00:09 PierreBoyeau

I solved this issue with conda.

conda install -c conda-forge glew
conda install -c conda-forge mesalib
conda install -c menpo glfw3

Then add your conda environment include to CPATH (put this in your .bashrc to make it permanent):

export CPATH=$CONDA_PREFIX/include

Finally, install patchelf with pip install patchelf

ezhang7423 avatar Jan 07 '22 19:01 ezhang7423

Thank you so much @ezhang7423! Really appreciate your help.

After installing these conda packages, I also had an issue to find lGL (cannot find -lGL). Mujoco-py README says to create a symlink using the libs in /usr, but I would need sudo privileges for that.

What I did was to copy the libGL.so.1 library to the lib directory on my conda env and then create a symlink there (ln -s libGL.so.1 libGL.so).

luckeciano avatar Apr 10 '22 22:04 luckeciano

I solved this issue with conda.

conda install -c conda-forge glew
conda install -c conda-forge mesalib
conda install -c menpo glfw3

Then add your conda environment include to CPATH (put this in your .bashrc to make it permanent):

export CPATH=$CONDA_PREFIX/include

Finally, install patchelf with pip install patchelf

Note that this works for python 3.8

qureshinomaan avatar Nov 09 '22 17:11 qureshinomaan

Thank you so much @ezhang7423! Really appreciate your help.

After installing these conda packages, I also had an issue to find lGL (cannot find -lGL). Mujoco-py README says to create a symlink using the libs in /usr, but I would need sudo privileges for that.

What I did was to copy the libGL.so.1 library to the lib directory on my conda env and then create a symlink there (ln -s libGL.so.1 libGL.so).

@luckeciano i had the same problem,have you solved it yet

RisingAuroras avatar Jan 06 '23 15:01 RisingAuroras

I solved this issue with conda.

conda install -c conda-forge glew
conda install -c conda-forge mesalib
conda install -c menpo glfw3

Then add your conda environment include to CPATH (put this in your .bashrc to make it permanent):

export CPATH=$CONDA_PREFIX/include

Finally, install patchelf with pip install patchelf

For people who installed these libraries to the non-base conda environment and have to batch script on a cluster machine: you might want to add this to your .bashrc. Note how CPATH comes after conda activate

conda activate BLABLA
export CPATH=$CONDA_PREFIX/include

Kelym avatar Jan 15 '23 04:01 Kelym

I solved this issue with conda.

conda install -c conda-forge glew
conda install -c conda-forge mesalib
conda install -c menpo glfw3

Then add your conda environment include to CPATH (put this in your .bashrc to make it permanent):

export CPATH=$CONDA_PREFIX/include

Finally, install patchelf with pip install patchelf

For people who installed these libraries to the non-base conda environment and have to batch script on a cluster machine: you might want to add this to your .bashrc. Note how CPATH comes after conda activate

conda activate BLABLA
export CPATH=$CONDA_PREFIX/include

Still not working for me.

leonasting avatar Feb 13 '23 05:02 leonasting

Thank you so much @ezhang7423! Really appreciate your help.

After installing these conda packages, I also had an issue to find lGL (cannot find -lGL). Mujoco-py README says to create a symlink using the libs in /usr, but I would need sudo privileges for that.

What I did was to copy the libGL.so.1 library to the lib directory on my conda env and then create a symlink there (ln -s libGL.so.1 libGL.so).

I had the same problem and it works for me. Thanks a lot!

Epicato avatar Nov 30 '23 00:11 Epicato

Thank you so much @ezhang7423! Really appreciate your help.

After installing these conda packages, I also had an issue to find lGL (cannot find -lGL). Mujoco-py README says to create a symlink using the libs in /usr, but I would need sudo privileges for that.

What I did was to copy the libGL.so.1 library to the lib directory on my conda env and then create a symlink there (ln -s libGL.so.1 libGL.so).

Hi, I solved this issue. But I still got missing -IOSMesa. Is there a similar way to solve this one as well? I don't have root access and use conda to install everything. Thank you.

sophistz avatar Apr 06 '24 10:04 sophistz

Thank you so much @ezhang7423! Really appreciate your help. After installing these conda packages, I also had an issue to find lGL (cannot find -lGL). Mujoco-py README says to create a symlink using the libs in /usr, but I would need sudo privileges for that. What I did was to copy the libGL.so.1 library to the lib directory on my conda env and then create a symlink there (ln -s libGL.so.1 libGL.so).

Hi, I solved this issue. But I still got missing -IOSMesa. Is there a similar way to solve this one as well? I don't have root access and use conda to install everything. Thank you.

@sophistz Hi! I met the same issue. I checked my $CONDA_PREFIX/lib and found libOSMesa32.so. It seemed to be lOSMesa in 32bit system, so I added this at the end of ~/.bashrc:

export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
if [ -f "$CONDA_PREFIX/lib/libOSMesa32.so" ] && [ ! -f "$CONDA_PREFIX/lib/libOSMesa.so" ]; then
    ln -s $CONDA_PREFIX/lib/libOSMesa32.so $CONDA_PREFIX/lib/libOSMesa.so
fi

After source ~/.bashrc my problem was solved, hope it would be helpful to you :)

Epiphanye30 avatar May 26 '24 17:05 Epiphanye30