赞
踩
一、背景
为了利用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.410807An 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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。