Lambda层中没有包装ZBAR
试图为我的lambda函数创建图层,该函数使用pyzbar库,该库需要单独下载ZBAR共享库作为依赖关系,并且无法与PIP一起安装。我的dockerfile看起来像这样:
FROM public.ecr.aws/lambda/python:3.8
COPY requirements.txt .
COPY lambda_function.py .
RUN pip install --upgrade pip &&\
pip install -r requirements.txt &&\
yum makecache &&\
yum -y install zbar
CMD [ "lambda_function.lambda_handler"]
而且我的要求
opencv-python-headless
pyzbar
pyzbar[scripts]
。
没有包装ZBAR可用
当我用许多其他软件包名称替换“ ZBAR”时,我会遇到相同的错误
trying to create a layer for my lambda function which uses the pyzbar library, which requires the zbar shared library as dependency, to be downloaded separately, and can't be installed with pip. My Dockerfile looks like this:
FROM public.ecr.aws/lambda/python:3.8
COPY requirements.txt .
COPY lambda_function.py .
RUN pip install --upgrade pip &&\
pip install -r requirements.txt &&\
yum makecache &&\
yum -y install zbar
CMD [ "lambda_function.lambda_handler"]
and my requirements.txt like this
opencv-python-headless
pyzbar
pyzbar[scripts]
I'm getting the error
No package zbar available
I'm getting the same error when I replace "zbar" with a number of other package names, e.g. libzbar0, libzbar-dev, zbar-tools, etc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ZBAR
不包含在默认的Amazon Linux存储库中,因此您需要添加EPEL回购。zbar
is not included in the default amazon linux repo, so you need to add the epel repo.您尝试安装
https://pypi.org/project/project/pyzbar/ 而不是pip,而不是
https://anaconda.org/conda-forge/conda-forge/pyzbar ://docs.conda.io/en/latest/miniconda.html” rel =“ nofollow noreferrer”> conda 。
PIP非常擅长快速求解Pure-Python安装。
康达解决了不同类别的问题。
在这里,您希望从
zbar
中合并二进制文件进入您的项目,您已经表达了一些
对PIP方法感到沮丧。
使用conda
环境.yml
文件是表达您要求的自然方式。
它将处理获得适合平台的二进制文件
对于您来说,因此您不必流汗细节。
You tried to install
https://pypi.org/project/pyzbar/ with pip, rather than
https://anaconda.org/conda-forge/pyzbar with conda.
Pip is very good at quickly solving pure-python installs.
Conda solves a different class of problems.
Here, you wish to incorporate binaries from
zbar
into your project, and you have expressed some
frustration with the pip approach.
Using a conda
environment.yml
filewould be the natural way to express your requirements.
It will deal with obtaining platform-appropriate binaries
for you, so you don't have to sweat the details.
我只有相同的问题,但是使用链接
https://dl.fedoraproject.org/pub/pub/epel/epel-release-latest-7.noarch.rpm
对我不起作用[fedora删除链接:(]。搜索很多后,我在Fedora People网站中找到了与Epel7的其他链接,对我有用:
I just have the same problem but using the link
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
didn't work for me [Fedora remove the link :( ].After searching a lot, I found other link to EPEL7 in the fedora people site and It works for me: