导入 pdfkit 在 AWS Lambda Python 中不起作用

问题描述 投票:0回答:0
import json
import os 
import boto3
import pdfkit
config = pdfkit.configuration(wkhtmltopdf="/opt/bin/wkhtmltopdf")

我正在使用上面的代码导入 pdfkit。我收到错误 errorMessage": "无法导入模块 'lambda_function': 没有名为 'pdfkit' 的模块"

我在 Lambda 中添加了一个层,URL arn:aws:lambda:ap-northeast-1:347599033421:layer:wkhtmltopdf-0_12_6:1

python-3.x amazon-s3 aws-lambda amazon-iam
© www.soinside.com 2019 - 2024. All rights reserved.