我使用pipenv来处理Python包依赖关系.

Python包使用两个包(名为pckg1pckg2),它们依赖于名为pckg3but from two different versions的同一个包.显示依赖关系树:

$ pipenv graph
  pckg1==3.0.0
    - pckg3 [required: >=4.1.0]
  pckg2==1.0.2
    - pckg3 [required: ==4.0.11]

try 安装依赖项:

$ pipenv install

Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches pckg3==4.0.11,==4.1.0,>=4.1.0 (from -r C:\Users\user\AppData\Local\Temp\pipenv-o7uxm080-requirements\pipenv-hwekv7dc-constraints.txt (line 2))
Tried: 3.3.1, 3.3.2, 3.3.3, 3.4.0, 3.4.2, 4.0.0, 4.0.0, 4.0.1, 4.0.1, 4.0.2, 4.0.2, 4.0.3, 4.0.3, 4.0.4, 4.0.4, 4.0.6, 4.0.6, 4.0.8, 4.0.8, 4.0.9, 4.0.9, 4.0.10, 4.0.10, 4.0.11, 4.0.11, 4.1.0, 4.1.0, 4.1.1, 4.1.1, 4.1.2, 4.1.2, 4.2.1, 4.2.1, 4.3.0, 4.3.0
There are incompatible versions in the resolved dependencies.

正如建议的那样,pip install --skip-lock可以解决这个问题,但依赖关系树仍然没有解决.

我很乐意告诉Pipenv来超越pckg2的要求,并指定pckg3>=4.1.0.

如何解决这个问题?

推荐答案

我经常犯这种错误.每次清除锁文件中的缓存都非常有效.

$ pipenv lock --pre --clear

Python-3.x相关问答推荐

海象表达可以放在方括号中而不是括号中吗?

Pandas groupby基于索引的连续列值相等

visual studio代码窗口中未激活虚拟环境11

如何使用魔杖扭曲图像

在python内的powershell中转义$_

当我在正则表达式末尾使用斜杠时,为什么会得到不同的结果?

CSV-DAT 转换时将引号添加到数据中

命名空间前缀无效

三重奏:为什么频道被记录为使用async with,而不是with?

为什么 mypy 不适用于 sqlalchemy?

如果原始字符串包含正斜杠,如何返回具有不同可能性的新字符串

判断 gekko 中的表达式

在字符串中查找正则表达式的所有模式

根据另一列值对多个数据框列进行分组

Pytorch:图像标签

如何从脚本中提取 PDF 文档的标题以进行重命名?

判断对 python 3 支持的要求

如何使 Python3 成为 Geany 中的默认 Python

如何模拟 open(...).write() 而不会出现没有这样的文件或目录错误?

类方法和实例方法同名