{
  "id": "python/pip-invalid-requirement-parsing-error",
  "signature": "ERROR: Invalid requirement: 'requests==2.31.0'  Hint: = is not a valid operator. Did you mean == ?",
  "signature_zh": "错误：无效的需求：'requests==2.31.0'  提示：= 不是有效的运算符。您是否想用 == ？",
  "regex": "ERROR:\\ Invalid\\ requirement:\\ 'requests==2\\.31\\.0'\\ \\ Hint:\\ =\\ is\\ not\\ a\\ valid\\ operator\\.\\ Did\\ you\\ mean\\ ==\\ \\?",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The requirements file or command line argument contains a malformed version specifier, most commonly a single '=' instead of '==', or a stray comma/space inside the version constraint that the packaging parser rejects.",
  "root_cause_type": "generic",
  "root_cause_zh": "requirements 文件或命令行参数中包含格式错误的版本说明符，最常见的是使用单个 '=' 而非 '=='，或版本约束内有多余的逗号/空格，导致打包解析器拒绝。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The parser is behaving correctly; the requirement string is genuinely invalid regardless of pip version.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is in the requirement text, not the environment, so a fresh venv reproduces it identically.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "--no-deps only skips dependency resolution, not parsing of the top-level requirement.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.98,
      "how": "Replace single '=' with '==' and remove spaces around specifiers:\n# bad\nrequests = 2.31.0\n# good\nrequests==2.31.0\n# or use a range\nrequests>=2.28,<3",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Shell metacharacters like '>' and '<' must be quoted:\npip install 'requests>=2.28,<3'",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}