Unable to import numpy 1.19.1 in AWS Lambda No module named 'numpy.core._multiarray_umath' Unable to import numpy 1.19.1 in AWS Lambda No module named 'numpy.core._multiarray_umath' numpy numpy

Unable to import numpy 1.19.1 in AWS Lambda No module named 'numpy.core._multiarray_umath'


I use the layer provided by Klayers to solve the problem.

Suppose you're running python 3.8 in us-east-1 region, according to this Klayers document, you can use arn:aws:lambda:ap-east-1:770693421928:layer:Klayers-python38-numpy:19 as your layer so that you can run import numpy in the lambda function.


Is your ec2 instance an amazon linux2 machine? You could also try building and run a docker image for amazon linux 2 and get the python libs compatible to the environment you need in your Lambda, by volume mounting to your host.

Something similat to docker lambda:

https://github.com/lambci/docker-lambda/tree/master/python3.8


AWS Lambda function don't work this way. If you open the Pandas package it'll be having the Numpy package with them but they would not work.The easy solution is to first download the required packages separately depending upon your python version and work enviroment from this site, unzip them and add them to your project directory. Create a .zip of your project and deploy it on AWS Lambda function. It'll work this way.You can refer to this site in order to follow the complete procedure.