Anaconda Prompt安装pytorch时出现CondaHTTPError报错

问题描述

在通过Anaconda prompt安装pytorch时遇到了这个问题。第一时间还是想到了是换源的问题。
报错

解决问题

1、执行以下两条语句,换成清华源,同时生成.condarc文件。

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

2、查看一下已经添加的频道

conda config --get channels

在这里插入图片描述
3、继续根据自己要求创建环境,进入环境

conda create -n freezing python=3.9
conda activate freezing

4、然后在新激活的环境中安装pytorch

conda install pytorch torchvision cudatoolkit=10.2

5、中间这里需要按一下y继续安装。
在这里插入图片描述
6、安装成功
在这里插入图片描述
7、验证
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/freezing_00/article/details/128933174
今日推荐