本文主要是介绍Anaconda 中遇到CondaHTTPError: HTTP 404 NOT FOUND for url的问题及解决办法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
最近在跑一个开源项目遇到了以下问题,查了很多资料都大(抄)同(来)小(抄)异(去)的,解决不了根本问题,费了很大的劲终于得以解决,记录如下:
1、问题及过程:
(myenv) D:\Workspace\python\XXXXX>conda install python=3.6.13
Solving environment: done.....Proceed ([y]/n)? yDownloading 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.050146An 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文件,内容替换如下:
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/cloudmsys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudbioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudmenpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudpytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudsimpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
关键点在于:default_channels用的官方的源,custom_channels用的清华的源。
问题最终得以解决。
这篇关于Anaconda 中遇到CondaHTTPError: HTTP 404 NOT FOUND for url的问题及解决办法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!