【pip】 The repository located at xxx is not a trusted or secure host and is being ignored

将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 we recommend you use HTTPS instead, 
otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.

将pip源切换为国内源的操作步骤,请查看《将pip源切换为国内镜像》

此处我用的是阿里云的镜像

解决办法:

在切换国内镜像源的时候,在pip.ini文件中可能做的事如下配置:
http://mirrors.aliyun.com/pypi/simple/
将其改为
https://mirrors.aliyun.com/pypi/simple/

 

看给的警告也可以明白需要改成https

你可能感兴趣的:(python,pip)