{
  "id": "pip/dependency-conflict-with-extras-syntax",
  "signature": "ERROR: Cannot install package-a==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[extra1]>=3.0 and package-b 2.0 depends on package-c[extra2]>=3.0. To fix this, you could try to: 1. loosen the range of package versions you've specified. 2. remove package versions to allow pip to attempt to solve the dependency conflict.",
  "signature_zh": "错误：无法安装 package-a==1.0 和 package-b==2.0，因为这些软件包版本存在冲突的依赖关系。冲突原因是：package-a 1.0 依赖 package-c[extra1]>=3.0，而 package-b 2.0 依赖 package-c[extra2]>=3.0。要解决此问题，您可以尝试：1. 放宽指定的软件包版本范围。2. 删除软件包版本以允许 pip 尝试解决依赖冲突。",
  "regex": "conflict is caused by:.*depends on.*\\[extra\\d+\\]>=.*and.*depends on.*\\[extra\\d+\\]>=",
  "domain": "pip",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Two packages require different extras of the same dependency package, and pip's resolver cannot install both extras simultaneously without a combined extra, leading to a dependency conflict.",
  "root_cause_type": "generic",
  "root_cause_zh": "两个软件包需要同一个依赖包的不同 extras，而 pip 的解析器无法在没有组合 extra 的情况下同时安装这两个 extras，导致依赖冲突。",
  "versions": [
    {
      "version": "pip 23.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 23.3",
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Installing package-c[extra1,extra2] manually before the conflicting packages",
      "why_fails": "Pip's resolver still sees the conflict because it evaluates the full dependency tree; manual pre-installation does not override the resolver's logic and may lead to an inconsistent state.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using --ignore-dependencies flag to force installation",
      "why_fails": "This can cause runtime import errors or broken functionality because the required extras are not installed correctly.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Downgrading both packages to versions that don't use extras",
      "why_fails": "Such versions may not exist or may introduce other security or compatibility issues.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Install the conflicting dependency with both extras using a combined specifier: pip install 'package-c[extra1,extra2]>=3.0' and then install the conflicting packages without version pins: pip install package-a package-b",
      "success_rate": 0.8,
      "how": "Install the conflicting dependency with both extras using a combined specifier: pip install 'package-c[extra1,extra2]>=3.0' and then install the conflicting packages without version pins: pip install package-a package-b",
      "condition": "",
      "sources": []
    },
    {
      "action": "Create a virtual environment and use pip-compile (from pip-tools) to generate a resolved requirements.txt that includes both extras: pip-compile --extra=extra1 --extra=extra2 requirements.in",
      "success_rate": 0.85,
      "how": "Create a virtual environment and use pip-compile (from pip-tools) to generate a resolved requirements.txt that includes both extras: pip-compile --extra=extra1 --extra=extra2 requirements.in",
      "condition": "",
      "sources": []
    },
    {
      "action": "Contact the maintainer of package-c to request a combined extra that includes both extra1 and extra2, or use a fork that merges them.",
      "success_rate": 0.3,
      "how": "Contact the maintainer of package-c to request a combined extra that includes both extra1 and extra2, or use a fork that merges them.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用组合说明符安装包含两个 extras 的冲突依赖：pip install 'package-c[extra1,extra2]>=3.0'，然后安装冲突的软件包而不固定版本：pip install package-a package-b",
    "创建虚拟环境并使用 pip-compile（来自 pip-tools）生成包含两个 extras 的已解析 requirements.txt：pip-compile --extra=extra1 --extra=extra2 requirements.in",
    "联系 package-c 的维护者，请求一个包含 extra1 和 extra2 的组合 extra，或使用合并了它们的 fork。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/topics/dependency-resolution/",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-11-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}