ERROR: No matching distribution found for【bug解决】

当遇到Pythonpip安装包时的错误,提示没有匹配的分布且警告源不安全,应考虑更新镜像源至HTTPS。可以信任阿里云镜像或切换到其他如清华、中国科技大学、华为的HTTPS镜像源来解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ERROR: No matching distribution found for【bug解决】

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it
anyway with ‘–trusted-host mirrors.aliyun.com’.
ERROR: Could not find a version that satisfies the requirement XXXXX (from versions: none)
ERROR: No matching distribution found for XXXXX

当你出现上述的问题的时候是因为现在的包下载主流的方式从http变成了https
原来的镜像是使用的http的
如果你要使用原来的镜像进行下载,可以选择对镜像源进行信任的操作:

pip install XXXX -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

更为有效的选择是更换镜像源:

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

本文以阿里云为例,其他镜像也可以选择,XXXX代表你要安装的库或者requirement.txt

下面是一些常见的支持https的源

清华:https://pypi.tuna.tsinghua.edu.cn/simple
中国科技大学 :https://pypi.mirrors.ustc.edu.cn/simple/
华为:https://repo.huaweicloud.com/repository/pypi/simple/  
阿里云:https://mirrors.aliyun.com/pypi/simple
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值