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

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

你可能感兴趣的:(bug,python,开发语言)