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 
    
    ...
    
    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//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//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(慢慢更新中……)

  • centos上安装docker会遇到另外一个问题,具体看centos8 安装docker解决:Failed to start docker.service
  • 然后会有包安装不成功,but none of the providers can be installed yum install提供了一些方法,不过我只能借助他的方法安装一个依赖包。
  • 鉴于此,需要重新搞一个安装方法,不然一直有问题。尝试下来这个可以使用Centos8安装Docker 全过程及报错解决

你可能感兴趣的:(RL,RL)