【发布时间】:2022-01-23 22:50:59
【问题描述】:
我在我的约束文件中指定了这个
asgiref==3.5.0
当我在 docker build 期间运行 pip3 install 时,它会抱怨
#12 24.67 ERROR: Cannot install -r /tmp/requirements.txt (line 16) because these package versions have conflicting dependencies.
#12 24.67
#12 24.67 The conflict is caused by:
#12 24.67 django 3.2.11 depends on asgiref<4 and >=3.3.2
#12 24.67 The user requested (constraint) asgiref==3.5.0
#12 24.67
#12 24.67 To fix this you could try to:
#12 24.67 1. loosen the range of package versions you've specified
#12 24.67 2. remove package versions to allow pip attempt to solve the dependency conflict
#12 24.67
#12 24.67 ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
Pip3 版本为 21.2.4,Linux 版本为 18.04,Python 3.6.9
也许我一直误解>=,我会认为asgiref==3.5.0 符合asgiref<4 and >=3.3.2 条件?
如果我指定asgiref==3.3.3 或asgiref==3.4.0,pip3 安装运行良好
我已经在本地安装了 3.5.0
【问题讨论】:
-
在我使用 Python 3.9 的机器上,安装
django==3.2.11会自行安装asgiref==3.5.0没有任何问题 (see)。使用干净的虚拟环境对其进行测试。 -
@H4iku 我在构建 docker 镜像时遇到了问题,很确定它是干净的。 Pip 版本是 21.2.4
-
您请求的具体版本是否在您有问题的平台上实际可用?为什么不为您自己的要求也指定
asgiref>=3.3.2,您需要最新的吗? -
你是对的,我今天早上又遇到了同样的问题,它找不到版本
3.5.0,但我出于某种原因在本地安装了它。