mujoco131 设置了环境变量却还在提示加入环境变量LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mujoco200/bin 解决方案

问题描述

今天在运行之前配置好的mujoco环境时,突然频繁报错:

  File "/xx/anaconda3/envs/csro/lib/python3.7/site-packages/gym/envs/mujoco/mujoco_env.py", line 12, in
    import mujoco_py
  File "/xx/anaconda3/envs/csro/lib/python3.7/site-packages/mujoco_py/__init__.py", line 3, in
    from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
  File "/xx/anaconda3/envs/csro/lib/python3.7/site-packages/mujoco_py/builder.py", line 507, in
    cymj = load_cython_ext(mujoco_path)
  File "/xx/anaconda3/envs/csro/lib/python3.7/site-packages/mujoco_py/builder.py", line 69, in load_cython_ext
    _ensure_set_env_var("LD_LIBRARY_PATH", lib_path)
  File "/xx/anaconda3/envs/csro/lib/python3.7/site-packages/mujoco_py/builder.py", line 118, in _ensure_set_env_var
    var_name, var_name, lib_path))
Exception: 
Missing path to your environment variable. 
Current values LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64:/usr/lib/nvidia:/usr/local/cuda/lib64:/xx/.mujoco/mjpro131/bin
Please add following line to .bashrc:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/xx/.mujoco/mujoco200/bin

解决方案

这里一直从mujoco-py中报错,猜测可能是mujoco-py版本出现了冲突。pip list,发现环境中还有一个mujoco-py=2.0.2.5,于是尝试卸载。

pip uninstall mujoco-py

卸载之后,重新运行报错代码,问题得到了解决。

撒花!

你可能感兴趣的:(bug解决方案,python)