{
  "id": "python/pip-connection-refused-proxy",
  "signature": "ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/ (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object>: Failed to establish a new connection: [Errno 111] Connection refused'))",
  "signature_zh": "错误：由于 OSError 无法安装包：HTTPSConnectionPool(host='pypi.org', port=443)：超过最大重试次数。原因：NewConnectionError，无法建立新连接：[Errno 111] 连接被拒绝。",
  "regex": "ERROR:\\ Could\\ not\\ install\\ packages\\ due\\ to\\ an\\ OSError:\\ HTTPSConnectionPool\\(host='pypi\\.org',\\ port=443\\):\\ Max\\ retries\\ exceeded\\ with\\ url:\\ /simple/\\ \\(Caused\\ by\\ NewConnectionError\\('<pip\\._vendor\\.urllib3\\.connection\\.HTTPSConnection\\ object>:\\ Failed\\ to\\ establish\\ a\\ new\\ connection:\\ \\[Errno\\ 111\\]\\ Connection\\ refused'\\)\\)",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "pip is honoring an HTTP(S) proxy from the environment (HTTP_PROXY/HTTPS_PROXY) that is unreachable or refusing connections.",
  "root_cause_type": "generic",
  "root_cause_zh": "pip 正在使用环境中的 HTTP(S) 代理（HTTP_PROXY/HTTPS_PROXY），但该代理不可达或拒绝连接。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Retries cannot succeed against a proxy that consistently refuses connections.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Trusted-host skips TLS verification, not proxy routing; the connection still fails.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Unset or correct the proxy env vars: `unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy` then retry, or set `proxy = http://user:pass@host:port` in pip.conf.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Bypass the proxy for PyPI: `pip install --proxy \"\" <pkg>` (empty string disables proxy for this invocation).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}