I have an AWS Lambda function which uses 'import awsgi'. I have uploaded the aws-wsgi & awsgi python dependencies, with other dependencies, to an S3 bucket. Then, uploaded all the dependencies to a Lambda Layer, connecting it with the aforementioned S3 bucket.
However, when I try to run the function, I get the following error:
{
"errorMessage": "Unable to import module 'lambda_function': No module named 'awsgi'",
"errorType": "Runtime.ImportModuleError",
"requestId": "81e04845-856a-4b98-85a4-7de4644e6244",
"stackTrace": []
}
I first tried only with aws-wsgi library (https://github.com/slank/awsgi) but then added the awsgi dependency to the zipped file too. But still getting the same error. To make sure that the issues in my local environment didn't interrupt, I installed the dependencies in a virtual environment.