Python错误集锦:The repository located at pypi.douban.com is not a trusted or secure host and is being ignored.

原文链接: http://www.juzicode.com/python-error-pip-the-repository-is-not-a-trusted-or-secure-host/

错误提示:

使用命令:pip install numpy -i http://pypi.douban.com/simple/ 安装模块时提示不是安全的主机:

The repository located at pypi.douban.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 pypi.douban.com’.
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy

错误原因:

1、pip不能使用http类型的连接,必须使用https的安全连接。

解决方法:

1、在-i选项中使用https开头的网址,选择安全的https连接:

相关阅读:

  1. Python进阶教程m1–模块(module)

如果本文还没有完全解决你的疑惑,你也可以在微信公众号“桔子code”后台给我留言,欢迎一起探讨交流。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注