1. miniconda安装

    wget <https://mirrors.bfsu.edu.cn/anaconda/miniconda/Miniconda3-py39_23.1.0-1-Linux-x86_64.sh>
    

    安装:

    bash Miniconda3-py39_23.1.0-1-Linux-x86_64.sh
    

    配置清华源:

    conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/> 
    conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/>
    conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/> 
    conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/>
    conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/>
    conda config --add channels conda-forge
    conda config --set show_channel_urls yes
    

    设置pip清华源:

    pip install pip -U
    pip config set global.index-url <https://pypi.tuna.tsinghua.edu.cn/simple>
    

    创建环境:

    conda create -n dreamer python=3.9.16
    conda config --set channel_priority true
    

    安装pytorch:

    conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
    # cuda 12.1
    conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
    

    Mujoco下载:

    wget <https://github.com/deepmind/mujoco/releases/download/2.1.0/mujoco210-linux-x86_64.tar.gz>
    tar -zxvf mujoco210-linux-x86_64.tar.gz
    mkdir .mujoco
    mv mujoco210 ~/.mujoco
    

    mujoco-py

    pip install mujoco-py==2.1.2.14 -i <https://pypi.tuna.tsinghua.edu.cn/simple>
    
    pip install cython==0.29.34 -i <https://pypi.tuna.tsinghua.edu.cn/simple>
    

    注意此处的Cython版本为0.29.34

    安装Meta-World

    meta-world(0.1.0版本,git下的已经是2.0.0版本了)

    git clone <https://github.com/rlworkgroup/metaworld.git>
    cd metaworld
    pip install -e .
    

    环境变量:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/xxx/.mujoco/mujoco210/bin
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia
    

    patchelf libglew-dev libosmesa6-dev libgl1-mesa-glx libglfw3

    安装d4rl

    pip install dm_control -i <https://pypi.tuna.tsinghua.edu.cn/simple>
    git clone <https://github.com/rail-berkeley/d4rl.git>
    git clone <https://github.com/Farama-Foundation/d4rl.git>
    git clone <https://github.com/aravindr93/mjrl.git>
    

    找到到d4rl目录下的setup.py文件,注释mujoco_py, dm_control, mjrl

    pip install **-**e **.**

    其他

    pyrep

    https://github.com/stepjam/PyRep

    CoppeliaSim_Edu

    wget <https://www.coppeliarobotics.com/files/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz> --no-check-certificate
    tar xvJf CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz
    mv CoppeliaSim_Edu_V4_1_0_Ubuntu20_04 CoppeliaSim
    

    export QT_QPA_PLATFORM=offscreen

    git clone <https://github.com/stepjam/PyRep.git>
    cd PyRep
    
    export COPPELIASIM_ROOT=/home/jmyang/CoppeliaSim
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COPPELIASIM_ROOT
    export QT_QPA_PLATFORM_PLUGIN_PATH=$COPPELIASIM_ROOT
    

    xvfb-run

python dataset_generator.py --save_path=./data --tasks=take_lid_off_saucepan --image_size=128,128 \\
--renderer=opengl --episodes_per_task=100 --variations=1 --processes=1
#/bin/sh

# Clean Process Space:
kill -9 `pidof xvfb-run`
kill -9 `pidof java`
kill -9 `pidof Xvfb`

# Launch a virtual screen
Xvfb :101 -screen 0 1024x768x24 2>&1 >/dev/null &
nohup sudo X &
export DISPLAY=:101
export DISPLAY=:0.0

xvfb-run --auto-servernum --server-args="-screen 0 1280x760x24" ./1.sh

# Launch the script
xvfb-run "/home/me/test.sh" &

history -c

安装gym==0.21.0

pip install setuptools==65.5.0
pip install --user wheel==0.38.0

bash Miniconda3-py39_23.1.0-1-Linux-x86_64.sh

克隆conda环境:

conda create -n B --clone A

切换conda

export PATH=/cache/myname/anaconda3/bin:$PATH . /cache/myname/anaconda3/etc/profile.d/conda.sh

切换清华元