python
network_error
ai_generated
partial
ERROR: pip._vendor.urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
ID: python/pip-connection-reset-by-peer
80%Fix Rate
85%Confidence
0Evidence
2025-10-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
Root Cause
The remote server forcefully closed the TCP connection, often due to firewall, timeout, or server overload.
generic中文
远程服务器强制关闭 TCP 连接,通常由于防火墙、超时或服务器过载。
Workarounds
-
70% success Use a retry mechanism with pip's --retries option
Run: pip install --retries 5 package
-
80% success Use a different network or proxy
Run: pip install --proxy http://proxy:port package
Dead Ends
Common approaches that don't work:
-
Increasing pip's timeout with --default-timeout
80% fail
The connection is reset, not timed out; timeout increase doesn't help.
-
Using a VPN to change IP
60% fail
May bypass some firewalls but not all; also adds latency.