昨天想conda安装pytorch,但是一直都报错:
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
捯饬了好久,一开始是发现我装的Anaconda是32bit的,到官网重新下载安装了64bit的,没有解决问题。然后昨天我是用清华的镜像,所以今天重装Anaconda后干脆改用了中科大和北师大的镜像:
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/pytorch/
还需要
conda config --set show_channel_urls yes
可以查看channels里是否添加了镜像:
conda config --show
最后是很重要的这句
conda config --set channel_priority flexible
然后我再试一下安装pytorch(我的Cuda驱动是11.0),成功了:
conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch -c nvidia