- Newest
- Most votes
- Most comments
Firstly, it appears that your lambda function code is nested inside the zip file/folder - which seems to be your library (nupeacock-backend-for-aws.zip)? Try moving your Lambda function code up to the root folder (nupeacock-main-backend) and run test again. It could be that your Lambda function code couldn't find the path to your library.
Secondly, you mentioned "layers", are your libraries deployed as Lambda Layer? Or you intend to just refer to your libraries as path-relative to your Lambda function as you did above?
Hello,
Python 3.12 is based on an Amazon Linux 2023 Amazon Machine Image (AMI). So, create the layer on an Amazon Linux 2023 OS.
Follow this article to troubleshoot this error , https://repost.aws/knowledge-center/lambda-import-module-error-python
thank you for your response but the issue is with calling the main lambda handler function itself (which is correctly located in the root folder of zip) and not with dependencies so not sure I agree with your response.
Relevant content
- asked 4 months ago
- AWS OFFICIALUpdated 3 years ago
Yes, already tried it and it works now.