Using aws lambda I am receiving the following error when the script is run with the numpy module:
Unable to import module 'process': /var/task/numpy/core/multiarray.so: invalid ELF header
Is this problem related to numpy itself or numpy specifically on aws lambda. What is an invalid ELF header?
Edit:
I believe this is related to native code execution, as stated in this answer "invalid ELF header" when using the nodejs "ref" module on AWS Lambda
The problem has to do with the multiarray.so file which was complied on my local computer's architecture. Spin up an ec2 instance and create your virtualenv with the necessary dependencies. This will cause it to compile with the correct architecture as used by Aws lambda. Then download your virtualenv from the ec2 instance and use that for lambda.
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