python
config_error
ai_generated
true
ERROR: The index URL 'http://pypi.example.com/simple' is not secure. pip requires HTTPS for all index URLs by default.
ID: python/pip-index-url-http-blocked
80%Fix Rate
88%Confidence
0Evidence
2024-09-03First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
pip refuses plain HTTP index URLs unless explicitly trusted. Internal mirrors are often HTTP-only, so pip blocks them to prevent MITM tampering.
generic中文
除非显式信任,否则 pip 拒绝纯 HTTP 索引 URL。内部镜像通常仅支持 HTTP,因此 pip 会阻止它们以防止 MITM 篡改。
Workarounds
-
95% success
pip install --index-url http://pypi.example.com/simple --trusted-host pypi.example.com package
-
92% success
pip config set global.trusted-host pypi.example.com && pip config set global.index-url http://pypi.example.com/simple
-
98% success
Configure the mirror with a valid TLS cert; then use https:// URL
Dead Ends
Common approaches that don't work:
-
95% fail
pip still refuses unless --trusted-host is added.
-
90% fail
Same rejection; the env var does not imply trust.