I am attempting to add an AWS Lambda layer to be able to use matplotlib in AWS Lambda. To do this, I downloaded the following file from Python Package Index:
matplotlib-3.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
I ensured this was the correct version of python and the correct operating system for my machine.
Next, I extracted the files into a folder on my machine called 'python' then created a zip folder with the same name (python). I uploaded this zip folder to my AWS Lambda Layer for matplotlib.
After successfully creating a lambda layer, I added this layer to my lambda function.
Despite this, I still get the following error when trying to execute a function with matplotlib imported:
{
"errorMessage": "Unable to import module 'lambda_function': No module named 'matplotlib'",
"errorType": "Runtime.ImportModuleError",
I tried redownloading the python package and re-creating the lambda layer multiple times, but I arrived at the same issue each time. Any help would be greatly appreciated.