CHH3213 / Note-Ubuntu_CHH3213

ubuntu系统CHH3213上做的笔记
0 stars 0 forks source link

55. 安装safety_gym和mujoco-py #55

Open CHH3213 opened 2 years ago

CHH3213 commented 2 years ago

1. mujoco安装

  1. Download the MuJoCo version 2.1 binaries for Linux or OSX.
  2. Extract the downloaded mujoco210 directory into ~/.mujoco/mujoco210.

    安装完成后,需要将mujoco链接到显卡,打开环境变量文件bashrc,填写以下路径:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mujoco210/bin
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia
    export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so

2.安装safety-gym

按照官方仓库安装:

git clone https://github.com/openai/safety-gym.git

cd safety-gym

pip install -e .

然后mujoco-py安装不上,查找资料后,将safety-gym文件夹下的setup.py修改成如下:

#!/usr/bin/env python

from setuptools import setup
import sys

assert sys.version_info.major == 3 and sys.version_info.minor >= 6, \
    "Safety Gym is designed to work with Python 3.6 and greater. " \
    + "Please install it before proceeding."

setup(
    name='safety_gym',
    packages=['safety_gym'],
    install_requires=[
        'gym~=0.15.3',
        'joblib~=0.14.0',
        'mujoco-py<2.2,>=2.1',
        'numpy~=1.17.4',
        'xmltodict~=0.12.0',
    ],
)

即可。

参考:

  1. https://blog.csdn.net/qq_29176963/article/details/106485696
  2. https://github.com/openai/mujoco-py
  3. https://github.com/openai/safety-gym/find/master