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.83k stars 810 forks source link

Installing mujoco-py on linux: ImportError: libglewosmesa.so: cannot open shared object file: No such file or directory #658

Open escape-velocity-labs opened 2 years ago

escape-velocity-labs commented 2 years ago

Hi, I'm trying to install mujoco-py on a linux environment to be used with the Gym library. However. The installation seems to be fine but when I first import the library, it performs the following compilation:

[1/1] Cythonizing /usr/local/lib/python3.7/dist-packages/mujoco_py/cymj.pyx running build_ext building 'mujoco_py.cymj' extension

And it spits out the following error:

ImportError: libglewosmesa.so: cannot open shared object file: No such file or directory

On Mac, the installation went fine. Does anyone know how to solve this?

renxiongwang commented 2 years ago

I am getting the same error with python 3.8

houyiwen commented 2 years ago

My code works well in linux terminal, however i got the same error ImportError: libglewosmesa.so: cannot open shared object file: No such file or directory when running in Pycharm.

I fix this problem by adding LD_LIBRARY_PATH in pycharm: Run --> Edit Configurations --> Enviroment variables Then add the LD_LIBRARY_PATH : Name: LD_LIBRARY_PATH Value: $LD_LIBRARY_PATH:/home/your_username/.mujoco/mujoco210/bin