autodl云服务器使用中的conda源报错

本文介绍了如何在Jupyter中使用conda虚拟环境时遇到HTTP429错误,通过更换源(如添加清华大学镜像)和修改.condarc文件来解决此问题,包括具体操作步骤和错误源的注释方法。
摘要由CSDN通过智能技术生成

一、背景

        为了利用jypyter打开conda虚拟环境运行,需要下载ipykenel。在base环境为nphm环境安装ipykenel,运行命令:

conda install -n nphm ipykernel

二、报错

Collecting package metadata (current_repodata.json): failed

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

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://mirrors.ustc.edu.cn/anaconda/pkgs/main/linux-64'

        这个报错是源的问题,在通过源获取包元数据时出现了HTTP 429错误。通过conda换源解决。

三、conda换源

        通过以下命令添加清华镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes

        但这样还不能解决问题,得把报错中有问题的源注释掉。

        通过find path -name  filename找到.condarc文件,在autodl服务器中,一般在/root/.condarc。

        修改.condarc文件,命令: vim .condarc

        把报错的链接源注释如下。

四、重新运行

         conda install -n nphm ipykernel

        

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值