pip源提示“not a trusted or secure host” 解决

今天pip出现了一个莫名其妙的问题

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 it is recommended to use HTTPS instead, 
otherwise you may silence this warning and allow it anyways with ‘--trusted-host mirrors.aliyun.com‘.

这段的意思是现在已经采用了HTTPS源,否则直接报错。

解决办法:
pip.conf 加上

trusted-host = mirrors.aliyun.com

也就是说,你的pip.conf文件的最终形态:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com

这样就可以了。。

文章来自:https://www.cnblogs.com/Yemilice/p/8848313.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3