Collecting package metadata (current_repodata.json): failed

文章描述了在使用conda时遇到的HTTP000CONNECTIONFAILED错误,尝试更换源未成功。问题在于channel_priority被设置为disabled,改为flexible后解决了问题。用户可以通过condaconfig--setchannel_priorityflexible命令来调整此设置。
摘要由CSDN通过智能技术生成

报错:

Collecting package metadata (current_repodata.json): done

Solving environment: failed with initial frozen solve. Retrying with flexible solve.

Collecting package metadata (repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/conda-forge/linux-64/repodata.json>

Elapsed: -

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//conda.anaconda.org/conda-forge/linux-64'

网上大多回答都是更换源,但根据他们的操作换源之后还是不行,另外之前在查看源的时候发现

channel_priority: disabled

channels:

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r

虽然源很多,但是channel_priority为disabled

可以使用以下方式查看描述

conda config --describe channel_priority
# # channel_priority (ChannelPriority)
# #   Accepts values of 'strict', 'flexible', and 'disabled'. The default
# #   value is 'flexible'. With strict channel priority, packages in lower
# #   priority channels are not considered if a package with the same name
# #   appears in a higher priority channel. With flexible channel priority,
# #   the solver may reach into lower priority channels to fulfill
# #   dependencies, rather than raising an unsatisfiable error. With channel
# #   priority disabled, package version takes precedence, and the
# #   configured priority of channels is used only to break ties. In
# #   previous versions of conda, this parameter was configured as either
# #   True or False. True is now an alias to 'flexible'.

后添加的channel 有更高的优先级, 即在检索软件时,会优先检索更高优先级的channel.

conda config --set channel_priority flexible

改回flexible运行成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值