CondaHTTPError问题解决方法

1 篇文章 0 订阅

在实验室服务器上配置环境安装pytorch的时候,报错: An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way

原因,软件包来源于国外网站,下载速度慢导致安装失败。

解决:https://blog.csdn.net/walk_power/article/details/82957796?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.channel_param

Step 1  :在命令行中输入并运行:(清华大学镜像

 
  1. conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/

  2. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

  3. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

  4. conda config --set show_channel_urls yes


Step 2 :更改配置文件

       按上面的设置镜像源后,把电脑C盘中的.condarc(路径为:C:\Users\Administrator\.condarc)文件以记事本方式打开,把里面的 -defaults这一行删除掉

 


Step 3 :安装

再输入: conda install pytorch就可以了。

类似的安装其他包就把Pytorch替换下来。

conda install [待安装库名]

   出现Proceed ([y]/n)? 输入y即可继续安装。

   输入IPython进入anaconda环境下“ import [库]” ,若未报错,则说明安装成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值