简体   繁体   English

添加Pyjwt到aws lambda function层

[英]Adding Pyjwt to aws lambda function layer

i'm trying to add Pyjwt library to aws lambda function layer but still have the same error no module named 'jwt'我正在尝试将 Pyjwt 库添加到 aws lambda function 层,但仍然有相同的错误没有名为“jwt”的模块

I used cloudshell to install pyjwt in virtual env and zip it and upload in an s3 bucket then added it as a layer in my lambda function and still have the same error "no module named jwt"我使用 cloudshell 在虚拟环境和 zip 中安装 pyjwt 并上传到 s3 存储桶中,然后将其作为一层添加到我的 lambda function 中,但仍然有相同的错误“没有名为 jwt 的模块”

I've also spent some time troubleshooting issues with lambda layers.我还花了一些时间解决 lambda 层的问题。 I've gotten them working using the following guidelines:我已经让他们按照以下准则工作:

  1. Make sure the layer's "compatible runtimes" match that of the package you installed确保该层的“兼容运行时”与您安装的 package 相匹配

  2. I've found that installing the package into a folder called "python" (in my case I was using a python function) and ziping the "python" folder and its contents我发现将 package 安装到名为“python”的文件夹中(在我的例子中,我使用的是 python 函数)并压缩“python”文件夹及其内容

Hope this helps as I've spent plenty of time on lambda layers issues希望这会有所帮助,因为我在 lambda 图层问题上花了很多时间

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS Lambda psycopg2 层 - AWS Lambda layer for psycopg2 AWS Lambda 层无法导入模块“lambda_function”:没有名为“pyarrow.lib”的模块 - AWS Lambda Layer Unable to import module 'lambda_function': No module named 'pyarrow.lib' 当我尝试添加为层并添加到 requirements.txt 时,为什么会出现错误:AWS Lambda 上没有名为“gspread”的模块? - Why do I get Error: No module named 'gspread' on AWS Lambda when I've tried adding as a layer and adding to requirements.txt? AWS Lambda 未在层中找到共享 Object 文件 - AWS Lambda not finding Shared Object File in Layer 使用 lambda 层连接到 AWS Keyspaces 时出错 - Errors connecting to AWS Keyspaces using a lambda layer 如何在lambda aws中使用图层导入numpy? - How to import numpy using layer in lambda aws? 如何将 package AWS CDK 转化为 Lambda 层? - How to package AWS CDK into Lambda layer? AWS Lambda - 调用另一个 lambda 函数的方法 - AWS Lambda - Invoke a method of another lambda function 如何使用 AWS 的无服务器框架获取最新的 Layer 版本 Lambda - How to get latest Layer version with serverless framework for AWS Lambda 如何从 AWS Lambda 层导入 JSON object? - How to import a JSON object from an AWS Lambda Layer?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM