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

问题最终得以解决。

相关推荐
Salt_07281 小时前
DAY 19 数组的常见操作和形状
人工智能·python·机器学习
无心水2 小时前
【Python实战进阶】2、Jupyter Notebook终极指南:为什么说不会Jupyter就等于不会Python?
python·jupyter·信息可视化·binder·google colab·python实战进阶·python工程化实战进阶
YFLICKERH3 小时前
【加密协议】SSL/TLS 协议工作流程
网络协议·ssl/tls
6***94153 小时前
报错The default superclass, “jakarta.servlet.http.HttpServlet“(已经配置好tomcat)
http·servlet·tomcat
上班日常摸鱼3 小时前
Shell脚本基础教程:变量、条件判断、循环、函数实战(附案例)
python
无心水3 小时前
【Python实战进阶】5、Python字符串终极指南:从基础到高性能处理的完整秘籍
开发语言·网络·python·字符串·unicode·python实战进阶·python工业化实战进阶
2301_807583233 小时前
了解python,并编写第一个程序,常见的bug
linux·python
小白学大数据3 小时前
构建混合爬虫:何时使用Requests,何时切换至Selenium处理请求头?
爬虫·python·selenium·测试工具
2401_827560203 小时前
【Python脚本系列】PyAudio+librosa+dtw库录制、识别音频并实现点击(四)
python·语音识别
BBB努力学习程序设计4 小时前
Python自动化脚本:告别重复劳动
python·pycharm