python
config_error
ai_generated
true
警告:位于 example.com 的仓库不是受信任或安全的主机,已被忽略。如果此仓库可通过 HTTPS 访问,我们建议您改用 HTTPS,否则您可以使用 '--trusted-host example.com' 消除此警告并允许它。
WARNING: The repository located at example.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 example.com'.
ID: python/pip-index-url-not-trusted
80%修复率
88%置信度
0证据数
2024-05-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
pip 配置为使用 HTTP 索引 URL,这是不安全的,默认会被忽略。
English
pip is configured to use an HTTP index URL, which is insecure and ignored by default.
解决方案
-
95% 成功率
Use HTTPS for the index URL: `pip install -i https://example.com/simple foo`.
-
80% 成功率
If HTTP is unavoidable, add `--trusted-host example.com` to the pip command or config.
无效尝试
常见但无效的做法:
-
90% 失败
The index is ignored, so packages won't be found.
-
40% 失败
Security risk; may still be blocked by network policies.