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

问题最终得以解决。

相关推荐
一世琉璃白_Y17 分钟前
pg配置国内数据源安装
linux·python·postgresql·centos
liwulin050622 分钟前
【PYTHON】COCO数据集中的物品ID
开发语言·python
小鸡吃米…23 分钟前
Python - XML 处理
xml·开发语言·python·开源
我赵帅的飞起29 分钟前
python国密SM4加解密
python·sm4加解密·国密sm4加解密
yaoh.wang1 小时前
力扣(LeetCode) 1: 两数之和 - 解法思路
python·程序人生·算法·leetcode·面试·跳槽·哈希算法
liwulin05062 小时前
【PYTHON-YOLOV8N】关于YOLO的推理训练图片的尺寸
开发语言·python·yolo
我送炭你添花2 小时前
Pelco KBD300A 模拟器:04+1.Python 打包详解:历史、发展与多种方式对比
python·测试工具·运维开发
yaoh.wang2 小时前
力扣(LeetCode) 27: 移除元素 - 解法思路
python·程序人生·算法·leetcode·面试·职场和发展·双指针
幸存者letp2 小时前
Python 常用方法分类大全
linux·服务器·python
无敌最俊朗@2 小时前
WebSocket与Webhook:实时通信技术对比
网络·websocket·网络协议