{
  "id": "python/pip-option-conflicts-with-requirement",
  "signature": "ERROR: Cannot install -r requirements.txt (line 4) and package==1.2.3 because these package versions have conflicting dependencies.",
  "signature_zh": "错误：无法安装 -r requirements.txt（第 4 行）和 package==1.2.3，因为这些包版本存在依赖冲突。",
  "regex": "ERROR:\\ Cannot\\ install\\ \\-r\\ requirements\\.txt\\ \\(line\\ 4\\)\\ and\\ package==1\\.2\\.3\\ because\\ these\\ package\\ versions\\ have\\ conflicting\\ dependencies\\.",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "A pinned version in requirements.txt conflicts with a version pinned in a nested requirements file or with an installed package's constraint.",
  "root_cause_type": "generic",
  "root_cause_zh": "requirements.txt 中固定的版本与嵌套 requirements 文件中的固定版本，或与已安装包的约束冲突。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Skips all transitive deps, so the environment is incomplete and runtime imports fail.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Loses reproducibility and may pull a version incompatible with other pins.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "-U upgrades top-level packages but does not resolve transitive conflicts and can break other pins.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Loosen the pin to a range: change 'package==1.2.3' to 'package>=1.2,<2'",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use pip-tools to compile a consistent lock: pip install pip-tools && pip-compile requirements.in",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Inspect the conflict: pip install --dry-run -r requirements.txt -v",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}