[英]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:
我已经让他们按照以下准则工作:
Make sure the layer's "compatible runtimes" match that of the package you installed确保该层的“兼容运行时”与您安装的 package 相匹配
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.