centos8 install mujoco

一、ubuntu 上安装mujoco

$ sudo apt-get install libglfw3 libglew2.0 libgl1-mesa-glx libosmesa6
然后pip install mujoco_py

二、centos没有apt install所对应的库

2.1 尝试解决centos8上安装mujoco环境依赖问题

  • 执行python -c "import mujoco_py"时,会报下面文件缺少的错误
    /home/$USER/mujoco-py/mujoco_py/gl/osmesashim.c:1:23: fatal error: GL/osmesa.h: No such file or directory
     #include <GL/osmesa.h>
    
    ...
    
    During handling of the above exception, another exception occurred:
      File "/home/$USER/miniconda3/envs/phiTrain/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'gcc' failed with exit status 1
    
  • centos7上好像可以解决此问题
    Hello, there! I got the same issues on CentOS 7. I tried this:
    
    conda install -c menpo osmesa
    C_INCLUDE_PATH=:$HOME/.conda/envs/<env-name>/include python -c "import mujoco_py"
    , then I got an error like "No such file or directory: 'patchelf'". According to #652, I installed
    sudo yum install patchelf
    ,and re-installed mujoco-py with python setup.py install . After that, everything goes right magically.
    有两人认同这种方法
    
  • pytorchRL好像也隐含的提到了这个问题
    • 使用conda安装所需依赖包
      $ conda activate mujoco_env
      $ conda install -c conda-forge glew
      $ conda install -c conda-forge mesalib
      $ conda install -c anaconda mesa-libgl-cos6-x86_64
      $ conda install -c menpo glfw3
      
    • 在centos8上不能解决问题

2.2 解决centos8上安装mujoco环境依赖问题

  • 另外一个链接解决了我的问题,无权限安装时如何处理GL/osmesa.h: No such file or directory 问题,合并另外一个有帮助的文档How to install mujoco-py in a server without root privileges?,结果整理如下
    conda install -c conda-forge glew
    conda install -c conda-forge mesalib
    conda install -c menpo glfw3
    
    C_INCLUDE_PATH=:$HOME/.conda/envs/<env-name>/include python -c "import mujoco_py"
    
    Then add your conda environment include to CPATH (put this in your .bashrc to make it permanent):
    export CPATH=$CONDA_PREFIX/include
    
    Finally, 缺少patchelf包,install patchelf with pip install patchelf
    我这里还出现了ImportError: libgcrypt.so.11: cannot open shared object file: No such file or directory问题,需要继续安装包 sudo yum -y install libgcrypt11.rpm 因为不太清楚是安装本地的还是资源库的,如果报错的话,则加上rpm下载的操作curl -o libgcrypt11.rpm ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/bosconovic:/branches:/home:/elimat:/lsi/openSUSE_Leap_15.1/x86_64/libgcrypt11-1.5.4-lp151.23.29.x86_64.rpm

至此,在centos8上安装mujoco完成了。

2.3 另外一条路线:docker(慢慢更新中……)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值