AWS Lambda Layer Dependency not being recognized.

0

Hi all so I have a python script I am running with lambda. When I test it without "import pandas" it works. But when I try doing it with pandas I get the following error:

Response
{
  "errorMessage": "Unable to import module 'lambda_function': No module named 'pandas'",
  "errorType": "Runtime.ImportModuleError",
  "stackTrace": []
}

Function Logs
START RequestId: dc5c7c9d-3e13-4d9a-88e8-0dbb8bba81ad Version: $LATEST
[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'pandas'
Traceback (most recent call last):END RequestId: dc5c7c9d-3e13-4d9a-88e8-0dbb8bba81ad
REPORT RequestId: dc5c7c9d-3e13-4d9a-88e8-0dbb8bba81ad	Duration: 1.72 ms	Billed Duration: 2 ms	Memory Size: 128 MB	Max Memory Used: 39 MB

Worth noting that the size of the layer is 44mb. I plan on eventually adding more packages. I created a zip file called aws_test2 which contains the following file path and content: image

Im sure it's something with my zip folder... New to AWS so any advice helps!

Kevin
asked 8 months ago178 views
1 Answer
0

Take a look here. Your dependencies should be stored under a specific folder (python or python/lib/python3.x/site-packages).

profile pictureAWS
EXPERT
Uri
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions