{
  "id": "pip/invalid-requirement-extra-spacing",
  "signature": "ERROR: Invalid requirement: 'package [extra1, extra2]' (line 1 of requirements.txt). Hint: = is not a valid operator. Did you mean == ?",
  "signature_zh": "错误：无效需求：'package [extra1, extra2]'（requirements.txt 第 1 行）。提示：= 不是有效运算符。您是不是想用 ==？",
  "regex": "ERROR: Invalid requirement: '[^']+' \\(line \\d+ of requirements\\.txt\\)\\. Hint: = is not a valid operator\\. Did you mean == \\?",
  "domain": "pip",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The requirements.txt contains an invalid syntax with a space between the package name and brackets for extras, or uses '=' instead of '==', causing pip to fail parsing.",
  "root_cause_type": "generic",
  "root_cause_zh": "requirements.txt 包含无效语法，包名和 extras 方括号之间有空格，或使用了 '=' 而不是 '=='，导致 pip 解析失败。",
  "versions": [
    {
      "version": "pip 23.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python 3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Adding a comment to requirements.txt does not fix the syntax error.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Running 'pip install --upgrade pip' does not change parsing rules; the syntax is still invalid.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using 'pip install -r requirements.txt --ignore-requires-python' ignores Python version checks but not syntax errors.",
      "fail_rate": 0.98,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Fix the syntax: remove spaces and use correct operator. Change 'package [extra1, extra2]' to 'package[extra1,extra2]' and ensure version specifier uses '==' not '='.",
      "success_rate": 0.95,
      "how": "Fix the syntax: remove spaces and use correct operator. Change 'package [extra1, extra2]' to 'package[extra1,extra2]' and ensure version specifier uses '==' not '='.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use pip's parsing to validate: 'pip install --dry-run -r requirements.txt' to catch syntax errors before full install.",
      "success_rate": 0.9,
      "how": "Use pip's parsing to validate: 'pip install --dry-run -r requirements.txt' to catch syntax errors before full install.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Regenerate requirements.txt with 'pip freeze' after manual install to avoid syntax issues.",
      "success_rate": 0.85,
      "how": "Regenerate requirements.txt with 'pip freeze' after manual install to avoid syntax issues.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "修复语法：移除空格并使用正确运算符。将 'package [extra1, extra2]' 改为 'package[extra1,extra2]'，并确保版本说明符使用 '==' 而不是 '='。",
    "使用 pip 的解析功能进行验证：'pip install --dry-run -r requirements.txt' 以在完全安装前捕获语法错误。",
    "手动安装后使用 'pip freeze' 重新生成 requirements.txt 以避免语法问题。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/reference/requirements-file-format/#extras",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-11-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}