1.下载并安装
wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
zsh Mini*.sh
~/miniconda3/bin/conda init zsh
source ~/.zshrc
2. 更改配置
rm ~/.condarc # 可能提示没有这个文件,没关系的
conda config --set show_channel_urls yes
echo "channels:
- defaults
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud">>~/.condarc
3. 创建环境
~/miniconda3/bin/conda create -n venv python=3.8
conda activate venv
echo "conda activate venv">>~/.zshrc #每次都自动activate
conda remove -n venv --all
4. 安装python包
conda install seaborn
conda install -c menpo opencv
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
5.使用效果