【发布时间】:2022-10-25 16:15:21
【问题描述】:
尽管没有实际的版本冲突,但有时 pip 会抱怨依赖冲突,例如在这种情况下,即使从约束.txt 中完全删除了 elastic-apm 的特定版本(只是将其留在 mypackage 的 setup.py 中),它仍然失败,如下所示:
ERROR: Cannot install elastic-apm because these package versions have conflicting dependencies.
The conflict is caused by:
mypackage 1.2.3 depends on elastic-apm
The user requested (constraint) elastic-apm
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
这是 pip 22.1.2 & python 3.10 使用这样的命令(即使用车轮的本地文件夹,而不是 PyPI)
pip install -r requirements.txt -c constraints.txt --no-index --find-links LOCALDIR --no-cache-dir --isolated
当实际上根本没有请求特定版本或范围时,为什么 pip 抱怨依赖冲突,更不用说冲突的依赖?
【问题讨论】: