在 Lambda 中使用 ReportLab

问题描述 投票:0回答:1

我尝试在 Lambda 函数中使用 ReportLab,但遇到一些问题。我添加了一个包含 ReportLab 及其依赖项的层,但出现错误:

"errorMessage": "Unable to import module 'lambda_function': cannot import name '_imaging' from 'PIL' (/opt/python/PIL/__init__.py)",

我的 Lambda 函数正在运行 Python 3.10。我应该尝试旧版本吗?有谁知道这个问题的解决方案?我读过一些有关使用 Docker 容器然后通过 zip 文件上传的内容。

amazon-web-services aws-lambda
1个回答
0
投票

这是由于使用reportlab时需要依赖Pillow模块造成的。也尝试安装它或将其添加到有帮助的图层中。

© www.soinside.com 2019 - 2024. All rights reserved.