anaconda 安装
下载
官方链接下载非常慢,可以从如下链接下载
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
$ conda info
active environment : base
active env location : /home/chengnanfeng/anaconda3
shell level : 1
user config file : /home/chengnanfeng/.condarc
populated config files :
conda version : 4.9.2
conda-build version : 3.20.5
python version : 3.8.5.final.0
virtual packages : __cuda=11.2=0
__glibc=2.31=0
__unix=0=0
__archspec=1=x86_64
base environment : /home/chengnanfeng/anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/chengnanfeng/anaconda3/pkgs
/home/chengnanfeng/.conda/pkgs
envs directories : /home/chengnanfeng/anaconda3/envs
/home/chengnanfeng/.conda/envs
platform : linux-64
user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Linux/5.8.0-36-generic ubuntu/20.04.1 glibc/2.31
UID:GID : 1000:1000
netrc file : None
offline mode : False
$ 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 --set show_channel_urls yes
$ pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
如果想删除某些 channel,使用如下命令
$ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
创建环境
$ conda create --name python_38-pytorch_1.7.0 python=3.8
安装pytorch
选择环境
https://pytorch.org/get-started/locally/
pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html -i https://pypi.mirrors.ustc.edu.cn/simple
pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -i https://pypi.mirrors.ustc.edu.cn/simple