{
  "id": "pip/requirements-file-syntax-error-extra",
  "signature": "ERROR: Invalid requirement: 'package==1.0 ; extra == \"test\"' - Expected end of string after extra specifier",
  "signature_zh": "错误：无效的需求：'package==1.0 ; extra == \"test\"' - 在额外说明符之后预期字符串结束",
  "regex": "ERROR: Invalid requirement: '.*extra == .*' - Expected end of string after extra specifier",
  "domain": "pip",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The extras syntax in requirements.txt is malformed: pip expects the extras condition to be a simple marker expression without quoting the extra name, or the extra name must match a valid PEP 508 marker.",
  "root_cause_type": "generic",
  "root_cause_zh": "requirements.txt 中的 extras 语法格式错误：pip 期望 extras 条件是一个简单的标记表达式，无需引用 extra 名称，或者 extra 名称必须匹配有效的 PEP 508 标记。",
  "versions": [
    {
      "version": "pip 19.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python 3.6-3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The quotes are interpreted as part of the package name or marker, causing a different parse error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Pip expects the marker value to be a string literal in quotes, e.g., extra == \"test\", not an unquoted identifier.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Pip does not support comma-separated extras in requirements.txt; it's invalid syntax.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use the correct PEP 508 marker syntax: package==1.0; extra == \"test\" (no space before semicolon, extra value in double quotes). Example:\npackage==1.0; extra == \"test\"",
      "success_rate": 0.95,
      "how": "Use the correct PEP 508 marker syntax: package==1.0; extra == \"test\" (no space before semicolon, extra value in double quotes). Example:\npackage==1.0; extra == \"test\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a separate requirements file for extras: create requirements-test.txt with just package==1.0 and install with pip install -r requirements-test.txt",
      "success_rate": 0.8,
      "how": "Use a separate requirements file for extras: create requirements-test.txt with just package==1.0 and install with pip install -r requirements-test.txt",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use the correct PEP 508 marker syntax: package==1.0; extra == \"test\" (no space before semicolon, extra value in double quotes). Example:\npackage==1.0; extra == \"test\"",
    "Use a separate requirements file for extras: create requirements-test.txt with just package==1.0 and install with pip install -r requirements-test.txt"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/reference/requirements-file-format/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2023-06-08",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}