【发布时间】:2022-01-21 14:14:49
【问题描述】:
我正在尝试为我的烧瓶服务器构建映像,我使用 pipreqs 生成了 requirements.txt。
requirements.txt 包含cryptography==2.8,并且每次尝试安装此版本时构建失败。不太清楚为什么,它甚至显示版本就在那里。
这是 docker 构建错误
22.90 ERROR: Could not find a version that satisfies the requirement cryptography==2.8
(from versions: 0.1, 0.2, 0.2.1, 0.2.2, 0.3, 0.4, 0.5, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.6, 0.6.1, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.9, 0.9.1, 0.9.2, 0.9.3, 1.0, 1.0.1, 1.0.2, 1.1, 1.1.1, 1.1.2, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.3, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.8.2, 1.9, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2, 2.2.1, 2.2.2, 2.3, 2.3.1, 2.4, 2.4.1, 2.4.2, 2.5, 2.6, 2.6.1, 2.7, 2.8, 2.9, 2.9.1, 2.9.2, 3.0, 3.1, 3.1.1, 3.2, 3.2.1, 3.3, 3.3.1, 3.3.2, 3.4, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.4.6, 3.4.7, 3.4.8, 35.0.0, 36.0.0, 36.0.1)
#8 22.90 ERROR: No matching distribution found for cryptography==2.8
#8 22.92 WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
#8 22.92 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
------
executor failed running [/bin/sh -c pip3 install -r requirements.txt]: exit code: 1
编辑: 即使没有复制任何烧瓶代码,以下构建也会失败
FROM python:3.8.10-alpine3.13
RUN pip install cryptography==2.8
请看一下,如果需要更多信息或我哪里出错了,请告诉我。谢谢
【问题讨论】:
-
为我工作。如果您手动运行
pip install cryptography==2.8而不是从 requirements.txt 文件安装会发生什么? -
@K.Mat
pip install cryptography==2.8在我的本地机器上工作,但在构建时不在映像中,我在 dockerfile 中尝试了RUN pip install cryptography==2.8但结果相同(构建失败)。如果有帮助,我正在使用python:3.9.10-alpine3.15 -
请分享一个可重现的最小示例来说明您的问题。有关如何操作的说明,请参阅 stackoverflow.com/help/minimal-reproducible-example
-
@Paolo 我进行了编辑并添加了产生错误的 dockerfile