https://pytorch.org/
https://pytorch.org/get-started/previous-versions/
conda install pytorch torchvision cudatoolkit=10.0
添加清华镜像
1 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
2 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
3 conda config --set show_channel_urls yes
添加pytorch镜像
1 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
4.安装pytorch:从官网获得conda指令 :conda install pytorch torchvision cudatoolkit=9.0 因为修改了镜像,所以去掉了官网的给的地址(-c pytorch)
5.验证是否安装成功:
1 import torch
2 torch.cuda.is_available()
如果是True恭喜你啦!
删除旧镜像源
C:\Users\jiangshan>conda config --show
C:\Users\jiangshan>conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/
https://www.cnblogs.com/jeshy/p/10516866.html
今天用conda install 任何包都会出现这个错误:
RemoveError: ‘setuptools’ is a dependency of conda and cannot be removed from
conda’s operating environment.
试了第一种方法:
pip uninstall install setuptools 然后conda install setuptools ,没有用,依然报错
第二种:
conda update conda 没用,报相同错误
第三种:
conda update --force conda,成功,没有报错。
重新安装一下其他的包,比如numpy,conda install numpy 成功,没有报错。看来是解决了。