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

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

Open
luckeciano opened this issue Aug 19, 2021 · 10 comments
Open

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

luckeciano opened this issue Aug 19, 2021 · 10 comments

Comments

@luckeciano
Copy link

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
Copy link

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

@ezhang7423
Copy link
Member

ezhang7423 commented Jan 7, 2022

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
Copy link
Author

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
Copy link

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
Copy link

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
Copy link

Kelym commented Jan 15, 2023

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
Copy link

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
Copy link

Epicato commented Nov 30, 2023

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
Copy link

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
Copy link

Epiphanye30 commented May 26, 2024

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

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

No branches or pull requests

10 participants