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用的清华的源。

问题最终得以解决。

相关推荐
步辞41 分钟前
Go语言怎么用channel做信号通知_Go语言channel信号模式教程【完整】
jvm·数据库·python
Ulyanov42 分钟前
《PySide6 GUI开发指南:QML核心与实践》 第一篇:GUI新纪元——QML与PySide6生态系统全景
开发语言·python·qt·qml·雷达电子对抗
曲幽1 小时前
FastAPI + SQLAlchemy 2.0 通用CRUD操作手册 —— 从同步到异步,一次讲透
python·fastapi·web·async·sqlalchemy·session·crud·sync·with
Dxy12393102161 小时前
Python 如何使用 XPath 定位元素:从入门到实战
python
用户8356290780511 小时前
Python 设置 PowerPoint 文档属性与页面参数
后端·python
weixin_424999361 小时前
mysql行级锁失效的原因排查_检查查询条件与执行计划
jvm·数据库·python
yaoxin5211231 小时前
389. Java IO API - 获取文件名
java·开发语言·python
Polar__Star1 小时前
uni-app怎么实现App端一键换肤 uni-app全局样式动态切换【实战】
jvm·数据库·python
用户8356290780511 小时前
使用 Python 自动管理 PowerPoint 幻灯片分节的方法
后端·python
IpdataCloud2 小时前
IP查询高精度怎么选?8个指标判断是否适合你
网络·网络协议·tcp/ip