conda出现http429报错:CondaHTTPError: HTTP 429 TOO MANY REQUESTS for url <xxx>

时间:2025-03-24 16:07:24

我的报错信息如下:

CondaHTTPError: HTTP 429 TOO MANY REQUESTS for url <https:///anaconda/pkgs/main/linux-64/current_repodata.json>
Elapsed: 00:46.305607

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.
'https:///anaconda/pkgs/main/linux-64

在报错的第一行我们可以看到是url:https://mirrors.ustc./anaconda/pkgs/main/linux-64/current_repodata.json有问题,只要把和ustc相关的源删掉就好了,步骤如下:

  1. 查看该环境下的所有channel(channel就是源,用来找你要安装的包的)

    conda config --show channels
    
  2. 执行命令后,我的电脑上显示:

    channels:
      - defaults
      - /anaconda/pkgs/free
      - /anaconda/pkgs/main
      - /anaconda/pkgs/main/
      - /anaconda/pkgs/free/
      - conda-forge
    
  3. 可以发现,我有两个和ustc相关的channel,删除这两个channel

    conda config --remove channels [channel的url]
    

    在我的电脑上就是:

    conda config --remove channels /anaconda/pkgs/main/
    conda config --remove channels /anaconda/pkgs/free/
    
    
  4. 这个时候再检查一下channel,可以看到没有ustc相关源了:

    执行:conda config --show channels
    
    展示的信息:
    channels:
      - defaults
      - /anaconda/pkgs/free
      - /anaconda/pkgs/main
      - conda-forge
    
  5. 然后再重新执行刚刚执行失败的命令,就没有http429报错了。