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'.

preguntada hace un año342 visualizaciones
2 Respuestas
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
EXPERTO
respondido hace un año
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
EXPERTO
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas