查看镜像源
conda config --show
1.添加清华镜像源
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 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
2.使用时,安装语句不能加 -c pytorch
conda install pytorch torchvision cudatoolkit=10.2
3.删除镜像源
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
参考:https://blog.csdn.net/weixin_43869268/article/details/107853405