使用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
本文介绍了解决使用sudopipinstallpackname时遇到的信任主机安全警告问题。通过修改pip配置文件~/.pip/pip.conf,指定信任的镜像源来避免安全警告,确保顺利安装Python包。
7万+

被折叠的 条评论
为什么被折叠?



