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.89k stars 813 forks source link

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

Open luckeciano opened 3 years ago

luckeciano commented 3 years ago

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!

PierreBoyeau commented 3 years ago

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

ezhang7423 commented 2 years ago

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

luckeciano commented 2 years ago

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).

qureshinomaan commented 2 years ago

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

RisingAuroras commented 1 year ago

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

Kelym commented 1 year ago

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
leonasting commented 1 year ago

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.

Epicato commented 1 year ago

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!

youyuan-zhang commented 8 months ago

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.

Epiphanye30 commented 6 months ago

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 :)