{
  "id": "pip/dependency-conflict-with-extras",
  "signature": "ERROR: Cannot install package-a[extra1,extra2]==1.0 and package-b==2.0 because these package versions have conflicting dependencies. The conflict is caused by: package-a 1.0 depends on package-c>=3.0 and package-b 2.0 depends on package-c<3.0.",
  "signature_zh": "错误：无法安装 package-a[extra1,extra2]==1.0 和 package-b==2.0，因为这些包版本存在依赖冲突。冲突由以下原因引起：package-a 1.0 依赖 package-c>=3.0，而 package-b 2.0 依赖 package-c<3.0。",
  "regex": "ERROR: Cannot install .+ and .+ because these package versions have conflicting dependencies\\. The conflict is caused by:",
  "domain": "pip",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "Two requested packages have mutually exclusive version constraints on a shared dependency, and pip's resolver cannot find a version of the shared dependency that satisfies both constraints simultaneously.",
  "root_cause_type": "generic",
  "root_cause_zh": "两个请求的包对共享依赖项有互斥的版本约束，pip 的解析器无法找到同时满足两个约束的共享依赖版本。",
  "versions": [
    {
      "version": "pip 23.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Force install both packages with --no-deps to skip dependency resolution",
      "why_fails": "While this allows installation, the conflicting dependency package-c will be missing or have an incompatible version, causing runtime ImportError or AttributeError.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade pip to the latest version hoping the resolver improves",
      "why_fails": "The conflict is fundamental to the version constraints; no resolver can satisfy mutually exclusive requirements unless constraints are relaxed.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Install an older version of package-a that depends on package-c<3.0: pip install 'package-a[extra1,extra2]<1.0' package-b==2.0",
      "success_rate": 0.75,
      "how": "Install an older version of package-a that depends on package-c<3.0: pip install 'package-a[extra1,extra2]<1.0' package-b==2.0",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a virtual environment and install package-c at a version that satisfies both (e.g., package-c==2.99), then install packages without dependencies: pip install package-c==2.99 && pip install --no-deps package-a[extra1,extra2]==1.0 package-b==2.0",
      "success_rate": 0.6,
      "how": "Use a virtual environment and install package-c at a version that satisfies both (e.g., package-c==2.99), then install packages without dependencies: pip install package-c==2.99 && pip install --no-deps package-a[extra1,extra2]==1.0 package-b==2.0",
      "condition": "",
      "sources": []
    },
    {
      "action": "Contact the package maintainers to relax version constraints or use a fork that resolves the conflict.",
      "success_rate": 0.3,
      "how": "Contact the package maintainers to relax version constraints or use a fork that resolves the conflict.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "安装旧版本的 package-a，该版本依赖于 package-c<3.0：pip install 'package-a[extra1,extra2]<1.0' package-b==2.0",
    "使用虚拟环境，安装同时满足两个条件的 package-c 版本（例如 package-c==2.99），然后不安装依赖地安装包：pip install package-c==2.99 && pip install --no-deps package-a[extra1,extra2]==1.0 package-b==2.0",
    "联系包维护者放宽版本约束，或使用解决冲突的分支。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/topics/dependency-resolution/#conflicting-dependencies",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-03-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}