{
  "id": "python/pip-install-error-invalid-constraint",
  "signature": "ERROR: Invalid constraint: 'package<2.0,>=1.0' (from constraints.txt)",
  "signature_zh": "错误：无效约束：'package<2.0,>=1.0'（来自 constraints.txt）",
  "regex": "ERROR:\\ Invalid\\ constraint:\\ 'package<2\\.0,>=1\\.0'\\ \\(from\\ constraints\\.txt\\)",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A constraints file contains a malformed version specifier, such as a comma-separated list without proper spacing or an invalid operator. pip's parser expects specific syntax.",
  "root_cause_type": "generic",
  "root_cause_zh": "约束文件包含格式错误的版本说明符，例如没有正确空格的逗号分隔列表或无效运算符。pip 的解析器期望特定语法。",
  "versions": [
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "May install incompatible versions, leading to runtime errors.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If the file is required for the project, ignoring it can break the build.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Correct the constraint syntax: use spaces around commas, e.g., 'package>=1.0,<2.0'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Validate constraints with pip install --dry-run -c constraints.txt to catch errors early.",
      "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": "2025-07-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}