Not being able to upload a module through layers in lambda

0

I firstly created a folder and then installed 'pytz' module in the folder using cmd. Then I zipped the folder and created a layer and added that layer to my lambda function but still it shows the error of- 'No module named pytz'.

질문됨 일 년 전345회 조회
2개 답변
0

Hi. Did you concerned about layer paths for python Lambda runtime?Function code can access the layer content without the need to specify the path by defining the same folder structure.

#example
pillow.zip
│ python/PIL
└ python/Pillow-5.3.0.dist-info

https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html

profile picture
전문가
답변함 일 년 전
0

Is my understanding correct that it is created with the same operation as this document?
https://docs.aws.amazon.com/lambda/latest/dg/python-package.html

In this case, you may succeed by changing the environment of the OS you created to Amazon Linux or Amazon Linux2.
https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html

You build your layer code into a .zip file archive using the same procedure that you would use for a function deployment package. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with Amazon Linux.

When you create a layer, you can specify whether the layer is compatible with one or both of the instruction set architectures. You may need to set specific compile flags to build a layer that is compatible with the arm64 architecture.

One way to ensure that you package libraries correctly for Lambda is to use AWS Cloud9. For more information, see Using Lambda layers to simplify your development process on the AWS Compute Blog.

profile picture
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠