python
network_error
ai_generated
true
WARNING: The repository located at myrepo.local 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 myrepo.local'. ERROR: Could not find a version that satisfies the requirement mypkg
ID: python/pip-index-url-http-insecure
80%Fix Rate
88%Confidence
0Evidence
2024-02-06First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
pip refuses to use an HTTP (non-TLS) index unless the host is explicitly marked as trusted.
generic中文
除非主机被明确标记为受信任,否则 pip 拒绝使用 HTTP(非 TLS)索引。
Workarounds
-
95% success
pip install --index-url http://myrepo.local/simple --trusted-host myrepo.local mypkg
-
90% success
# ~/.config/pip/pip.conf [global] index-url = http://myrepo.local/simple trusted-host = myrepo.local
Dead Ends
Common approaches that don't work:
-
90% fail
HTTP index is still rejected without --trusted-host.
-
85% fail
Environment variable changes the index but not the trust decision.
-
95% fail
Cache does not affect trust evaluation of the index host.