CondaHTTPError: HTTP 000 CONNECTION FAILED for url ...... 解决过程

本文讲述使用Anaconda创建新环境时出现CondaHTTPError连接失败的问题及解决步骤。作者在Windows 10系统、Anaconda 5版本下,通过修改.condarc文件,调整镜像地址,最终用可打开的https网址解决问题,还提醒借鉴经验要具体问题具体分析。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用anaconda创建一个新的环境,执行“conda install”命令,结果出现了“CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/current_repodata.json”。以下是我的解决步骤。

一、电脑的环境
操作系统:windows10 64位

Anaconda版本:conda 5

二、解决步骤
进入”C:\Users\Administrator“,打开“.condarc“,看到这个文件为:
(.condarc文件打开方法二:win+R,然后输入%HOMEPATH%)

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - defaults
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
ssl_verify: true
show_channel_urls: true

尝试打开镜像的第一个地址“https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main”,打开以后看到的是以下界面:
在这里插入图片描述
似乎找到了问题所在:镜像地址应该加上"win-64"。
你也可能会在channels:下面看到 ”- default“,请删除它。

最终的".condarc"为:

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
ssl_verify: true
show_channel_urls: true

有文章说要将https改为http,但是我试了不行,http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/这个网址都打不开,https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/这个才打得开,所以最终用这个打得开的网址解决成功。

参考这篇文章的解决思路:Anaconda建立新的环境,出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url … 解决过程

感悟:有时候某个博客里的经验是针对他当时的环境和遇到的问题的解决方法,我们不能照搬,而只能借鉴,因为我们的环境和问题可能又不同了,而那篇博客里可能并没有考虑到我现在遇到的问题,所以遇到问题要实事求是、与时俱进、具体问题具体分析。


如果对您有帮助的话,请博主喝杯奶茶吧~
在这里插入图片描述

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值