windows版

打开Anaconda prompt

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/

# for legacy win-64
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/

conda activate pytorch

然后把官网复制的代码删除 -c pytorch

参考博客如下:

https://www.cnblogs.com/zhouzhiyao/p/11784055.html

https://blog.csdn.net/WannaSeaU/article/details/88427010