ERROR
pip
config_error
ai_generated
true
ERROR: Cannot install <package-a> and <package-b> because these package versions have conflicting dependencies. The conflict is caused by: <package-c> 1.0 depends on <package-d>!=2.0 and <package-e> 2.0 depends on <package-d>==2.0.
ID: pip/dependency-conflict-with-extras-and-markers
82%Fix Rate
89%Confidence
1Evidence
2023-04-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| pip 22.0 | active | — | — | — |
| pip 23.1.2 | active | — | — | — |
| pip 24.0 | active | — | — | — |
Root Cause
Two or more packages in the dependency tree require mutually exclusive versions of a shared dependency, creating an unsatisfiable constraint that pip's resolver cannot resolve.
generic中文
依赖树中的两个或多个包要求共享依赖的互斥版本,创建了 pip 解析器无法解决的不可满足的约束。
Official Documentation
https://pip.pypa.io/en/stable/topics/dependency-resolution/#dealing-with-dependency-conflictsWorkarounds
-
85% success Use a virtual environment and install compatible versions explicitly. Example: `pip install <package-c>==1.0 <package-e>==1.5` where versions are known to be compatible. Pin all dependencies in a requirements.txt file after testing.
Use a virtual environment and install compatible versions explicitly. Example: `pip install <package-c>==1.0 <package-e>==1.5` where versions are known to be compatible. Pin all dependencies in a requirements.txt file after testing.
-
70% success Use `pip install <package-a> <package-b> --upgrade --upgrade-strategy eager` to force pip to upgrade all dependencies to the latest compatible versions, which may resolve the conflict.
Use `pip install <package-a> <package-b> --upgrade --upgrade-strategy eager` to force pip to upgrade all dependencies to the latest compatible versions, which may resolve the conflict.
中文步骤
使用虚拟环境并显式安装兼容版本。示例:`pip install <package-c>==1.0 <package-e>==1.5`,其中版本已知兼容。测试后在 requirements.txt 文件中固定所有依赖项。
使用 `pip install <package-a> <package-b> --upgrade --upgrade-strategy eager` 强制 pip 将所有依赖项升级到最新的兼容版本,这可能会解决冲突。
Dead Ends
Common approaches that don't work:
-
75% fail
This flag skips dependency resolution entirely, but the installed packages may be broken at runtime due to missing or conflicting dependencies.
-
80% fail
The `--no-deps` flag only prevents installation of dependencies for that specific package, but the conflict may still exist in the shared dependency tree; runtime errors are likely.