Anaconda 中遇到CondaHTTPError: HTTP 404 NOT FOUND for url的问题及解决办法

最近在跑一个开源项目遇到了以下问题,查了很多资料都大(抄)同(来)小(抄)异(去)的,解决不了根本问题,费了很大的劲终于得以解决,记录如下:

1、问题及过程:

python 复制代码
(myenv) D:\Workspace\python\XXXXX>conda install python=3.6.13 
Solving environment: done

.....

Proceed ([y]/n)? y


Downloading and Extracting Packages
certifi-2021.5.30    | 142 KB    |                |   0%  
......

CondaHTTPError: HTTP 404 NOT FOUND for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/certifi-2021.5.30-py36haa95532_0.tar.bz2>
Elapsed: 00:00.050146

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.

CondaHTTPError: HTTP 404 NOT FOUND for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/python-3.6.13-h3758d61_0.tar.bz2>
Elapsed: 00:00.189201

.......

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.

2、解决办法:

在用户目录下(如win10中C:\Users\xxx\),修改.condarc文件,内容替换如下:

python 复制代码
channels:
  - defaults
show_channel_urls: true
channel_alias: https://repo.anaconda.com
default_channels:
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/free
  - https://repo.anaconda.com/pkgs/r
  - https://repo.anaconda.com/pkgs/pro
  - https://repo.anaconda.com/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

关键点在于:default_channels用的官方的源,custom_channels用的清华的源。

问题最终得以解决。

相关推荐
benchmark_cc44 分钟前
如何用 Python + QuantDash 快速构建高胜率“配对交易(Pairs Trading)”策略?
开发语言·人工智能·python·pandas·量化交易·quantdash
Python+992 小时前
Java 枚举类(Enum)详解:从基础到高级应用
java·开发语言·python
dunge20263 小时前
2026年7月最新ChatGPT Plus / Pro 与 Codex:当 AI Agent 最新5.6版本来袭,必须理解事务、幂等与补偿
开发语言·人工智能·python
CHANG_THE_WORLD4 小时前
TCP 三次握手彻底解析:SYN、ACK、SEQ、确认号与状态迁移
网络·网络协议·tcp/ip
2501_915106324 小时前
TraceEagle 代理抓包教程 本机和手机的 HTTPS 抓包方法
网络协议·计算机网络·网络安全·ios·adb·https·udp
小白学大数据5 小时前
两周完成爬虫技术栈升级:Scrapy 迁移 Crawlo 的路径与取舍
爬虫·python·scrapy
用户8356290780515 小时前
使用 Python 在 Excel 中添加和自定义文本框
后端·python
小心我捶你啊5 小时前
数据采集和Web解锁不是一回事,从用途到规则区分
前端·爬虫·网络协议
总裁余(余登武)5 小时前
python多个py文件打包【解决exe不能移动运行bug】
python
DLYSB_5 小时前
基于 HTTP API 与 Modbus 协议的多源监控声光语音联动告警系统设计与实现
网络·网络协议·http·报警灯