python config_error ai_generated true

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

Also available as: JSON · Markdown · 中文
80%Fix Rate
88%Confidence
0Evidence
2024-05-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

Root Cause

pip is configured to use an HTTP index URL, which is insecure and ignored by default.

generic

中文

pip 配置为使用 HTTP 索引 URL,这是不安全的,默认会被忽略。

Workarounds

  1. 95% success
    Use HTTPS for the index URL: `pip install -i https://example.com/simple foo`.
  2. 80% success
    If HTTP is unavoidable, add `--trusted-host example.com` to the pip command or config.

Dead Ends

Common approaches that don't work:

  1. 90% fail

    The index is ignored, so packages won't be found.

  2. 40% fail

    Security risk; may still be blocked by network policies.