【mujoco】Ubuntu20.04中解决mujoco报错raise error.MujocoDependencyError

【mujoco】Ubuntu20.04中解决mujoco报错raise error.MujocoDependencyError

1. 报错的具体情况

笔者已经成功在ubuntu环境下配置了mujoco_py,具体细节请参考这篇博客:【mujoco】Ubuntu20.04配置mujoco210

笔者在运行一些mojuco的代码时出现了下列问题

raise error.MujocoDependencyError('To use MuJoCo, you need to either populate ~/.mujoco/mjkey.txt and 
~/.mujco/mjpro131, or set the MUJOCO_PY_MJKEY_PATH and MUJOCO_PY_MJPRO_PATH environment variables 
appropriately. Follow the instructions on https://github.com/openai/mujoco-py for where to obtain these.')
mujoco_py.error.MujocoDependencyError: To use MuJoCo, you need to either populate ~/.mujoco/mjkey.txt 
and ~/.mujco/mjpro131, or set the MUJOCO_PY_MJKEY_PATH and MUJOCO_PY_MJPRO_PATH environment variables 
appropriately. Follow the instructions on https://github.com/openai/mujoco-py for where to obtain these.

分析这个问题我们发现,问题中提示我们需要在~/.mujoco路径下新增两个文件,一个是mjkey.txt,另一个是文件夹mjpro131

2. 解决过程

查阅了一些资料后,笔者发现了解决办法,从官网分别下载两个文件,放置到上面要求的位置中即可。
分别需要下载两个文件,首先是下载mjkey.txt,这个文件是一个密钥,链接如下: https://www.roboti.us/license.html

打开链接,直接下载即可

Image

然后需要下载mjpro131,同样是进入官网,链接如下: https://www.roboti.us/download.html

Image

笔者的系统是Ubuntu20.04所以这里需要下载linux版的,下载完毕后记得解压缩,放置在路径~/.mujoco中即可,如下所示

Image

以上就成功解决了该问题。

3. 其他问题

3.1 ModuleNotFoundError: No module named ‘OpenGL’

报错提示没有相关的依赖OpenGL,我们只需要补上这个依赖就行

conda activate YourEnvName		# 激活你自己的虚拟环境
pip install pyOpenGL  -i https://pypi.douban.com/simple

3.2 ModuleNotFoundError: No module named ‘sklearn’

报错提示没有相关的依赖sklearn,我们只需要补上这个依赖就行

conda activate YourEnvName		# 激活你自己的虚拟环境
pip install scikit-learn

Reference

https://blog.csdn.net/dream6985/article/details/128102791
【mujoco】Ubuntu20.04配置mujoco210
ModuleNotFoundError: No module named ‘OpenGL‘

猜你喜欢

转载自blog.csdn.net/qq_44940689/article/details/135381429