pip install出错 not a trusted or secure host解决方案

来源:互联网 发布:阿里云2m带宽 编辑:程序博客网 时间:2024/05/16 10:01

使用sudo pip install packname时会提示错误:

The repository located at http://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’.

解决方法是,修改pip配置文件~/.pip/pip.conf如下:

[global]
timeout = 6000
index-url = http://pypi.douban.com/simple/
[install]
use-mirrors = true
mirrors = http://pypi.douban.com/simple/
trusted-host = pypi.douban.com

阅读全文
0 0