我正在尝试将我的python应用程序部署到一个docker容器中。应用程序使用pyzbar包进行QR解码。
在Mac上,我使用brew install zbar安装共享库,并且在我的需求文件中
pypng==0.20220715.0
pyzbar==0.1.9
PyQRCode==1.2.1我有以下Dockerfile:
FROM python:3.7-slim-buster
RUN apt install python-zbar最后一个文件的输出是:
ERROR [2/8] RUN apt install python-zbar 0.2s
------
> [2/8] RUN apt install python-zbar:
#5 0.186
#5 0.186 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#5 0.186
#5 0.188 Reading package lists...
#5 0.194 Building dependency tree...E: Unable to locate package python-zbar
#5 0.195
#5 0.195 Reading state information...
------
executor failed running [/bin/sh -c apt install python-zbar]: exit code: 100有人知道码头形象会支持两者吗?
发布于 2022-10-05 22:36:22
根据Linux的zbar博士,您需要首先安装libzbar0,然后执行pip install pyzbar。您可以按照Docker图像进行如下操作:
FROM python:3.7-slim-buster
RUN apt-get update && apt-get install libzbar0 -y && pip install pyzbar对exit code: 100错误的一点解释:
当正在运行的命令等待用户输入时,通常会发生此错误。对于apt-get install,您可以传递-y标志,以避免apt提示用户输入。
https://stackoverflow.com/questions/73966892
复制相似问题