I'm trying to generate a graph with matplotlib in python lambda function. i imported a layer with the library mathplotlib, but it doesn't work. The idea is generate a graph, save it like temp file and upload to S3.
When i run the code, the output is:
Response:
{
"errorMessage": "Unable to import module 'lambda_function': cannot import name 'WinDLL' from 'ctypes' (/var/lang/lib/python3.7/ctypes/__init__.py)",
"errorType": "Runtime.ImportModuleError"
}
Help!
I need intall another library? I saw that is a problem with numpy library, but i don't know.
Exist another library to generate graphs?
I assume you used a windows OS to package your python libraries (via virtualenv) and uploaded them as a zip file in the create function section of AWS-Lambda.
AWS is linux based so the incompatibility might stem from the fact that you packaged your libraries on windows.
Basically, you would need to do the packaging in a linux machine. Maybe using a free tier version of ec2-linux. Moreover, the matplotlib library has it's own compatibility issues so there is no real guarantee that this approach will work.
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With