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

about import mujoco_py #772

Open zcswdt opened 1 year ago

zcswdt commented 1 year ago

import mujoco_py Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/dist-packages/mujoco_py/init.py", line 2, in from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException File "/usr/local/lib/python3.8/dist-packages/mujoco_py/builder.py", line 504, in cymj = load_cython_ext(mujoco_path) File "/usr/local/lib/python3.8/dist-packages/mujoco_py/builder.py", line 74, in load_cython_ext _ensure_set_env_var("LD_LIBRARY_PATH", lib_path) File "/usr/local/lib/python3.8/dist-packages/mujoco_py/builder.py", line 120, in _ensure_set_env_var raise Exception("\nMissing path to your environment variable. \n" Exception: Missing path to your environment variable. Current values LD_LIBRARY_PATH=/usr/local/lib/python3.8/dist-packages/torch/lib:/usr/local/lib/python3.8/dist-packages/torch_tensorrt/lib:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 Please add following line to .bashrc: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin

abdulghani91 commented 1 year ago

I have the same problem I added the LD_LIBRARY_PATH, but it still does not work did you find any solution?

import mujoco_py Traceback (most recent call last): File "", line 1, in File "/home/user/.local/lib/python3.10/site-packages/mujoco_py/init.py", line 2, in from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException File "/home/user/.local/lib/python3.10/site-packages/mujoco_py/builder.py", line 504, in cymj = load_cython_ext(mujoco_path) File "/home/user/.local/lib/python3.10/site-packages/mujoco_py/builder.py", line 74, in load_cython_ext _ensure_set_env_var("LD_LIBRARY_PATH", lib_path) File "/home/user/.local/lib/python3.10/site-packages/mujoco_py/builder.py", line 120, in _ensure_set_env_var raise Exception("\nMissing path to your environment variable. \n" Exception: Missing path to your environment variable. Current values LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64${LD_LIBRARY_PATH:+:} Please add following line to .bashrc: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/.mujoco/mujoco210/bin

Anna-fence commented 10 months ago

I meet the problem too. The solution in this issue https://github.com/openai/mujoco-py/issues/267 works for me.

sainavaneet commented 7 months ago

use this commands in terminal

echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/.mujoco/mujoco210/bin' >> ~/.bashrc next source ~/.bashrc