python data_error ai_generated true

错误:无法安装 pkg-a 和 pkg-b,因为这些包版本有冲突的依赖。

ERROR: Cannot install pkg-a and pkg-b because these package versions have conflicting dependencies.

ID: python/pip-dependency-conflicts

其他格式: JSON · Markdown 中文 · English
80%修复率
90%置信度
0证据数
2024-10-01首次发现

版本兼容性

版本状态引入弃用备注
3.7 active
3.8 active
3.9 active

根因分析

两个包需要共享依赖的不兼容版本。

English

Two packages require incompatible versions of a shared dependency.

generic

解决方案

  1. 90% 成功率
    pip-compile requirements.in && pip install -r requirements.txt
  2. 85% 成功率
    python -m venv venv1 && source venv1/bin/activate && pip install pkg-a

无效尝试

常见但无效的做法:

  1. 80% 失败

    Doesn't resolve the underlying dependency conflict.

  2. 70% 失败

    Will likely break one of the packages.