{
  "id": "python/packaging-marker-evaluation-error",
  "signature": "packaging.markers.UndefinedEnvironmentName: 'extra' is not defined in environment markers",
  "signature_zh": "packaging.markers.UndefinedEnvironmentName：环境标记中未定义 'extra'",
  "regex": "packaging\\.markers\\.UndefinedEnvironmentName:\\ 'extra'\\ is\\ not\\ defined\\ in\\ environment\\ markers",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The marker uses 'extra' which is only valid in certain contexts like requirements files, not in all marker evaluations.",
  "root_cause_type": "generic",
  "root_cause_zh": "标记使用了 'extra'，该标记仅在需求文件等特定上下文中有效，并非在所有标记评估中都有效。",
  "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": "The marker evaluation does not read arbitrary environment variables; 'extra' is a special key.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Ignoring may lead to incorrect dependency resolution.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Requirement('package; sys_platform == \"linux\"')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "from packaging.markers import Marker; m = Marker('extra == \"test\"'); m.evaluate({'extra': 'test'})",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-04-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}