AWS Lambda and Numpy Libraries - Importing numarray numpy add-in failed

Trying to successfully run numpy on AWS Lambda. The information I read indicates that you need to use the numpy libraries specially compiled / compatible with AWS EC2.

Do this, I first followed the instructions to compile numpy to an ec2 instance, here:

Install numpy on Amazon EC2

Then I copied the newly created numpy to my Lambda application folder on my desktop, archived the Lambda deployment package containing the entire directory.

After running my Lambda function, I still get this error:

Failed to import numarray numpy extension module. Most likely, you are trying to import a failed numpy assembly. If you are working with numpy git repo, try git clean -xdf(deletes all files that are not related to version control). Otherwise reinstall numpy.

Sentence?

+5
source share
1 answer

Adding an answer for anyone who finds this old question.

Fortunately, this problem has now been resolved using the Lambda Layer. AWS even provides a NumPy and SciPy layer. You can connect it directly to your lambda in the web console or use this ARNarn:aws:lambda:us-east-1:668099181075:layer:AWSLambda-Python36-SciPy1x:2

0
source

Source: https://habr.com/ru/post/1686250/


All Articles