I downloaded numpy from google and put it in lib folder and in script I am importing as - import lib.numpy as np but this is not working . Error is coming as no module name numpy.
I am running script in amazon aws. Could you please help me how to resolve this?
I am importing the pandas in the same way but in numpy it is giving error.
-
Can you share the project structure here?Suyog Shimpi– Suyog Shimpi2021年05月18日 12:30:10 +00:00Commented May 18, 2021 at 12:30
-
@SuyogShimpi I downloaded the libraries then put it in lib folder then zip script and lib and place in s3 bucket and attached the s3 location in aws lambda and ran the script.Shivika Patel– Shivika Patel2021年05月18日 12:31:59 +00:00Commented May 18, 2021 at 12:31
1 Answer 1
Getting numpy into a AWS Lambda is hard if you want to do it yourself. If you really want to do it on your own, checkout this answer.
Fortunately, there is a simpler option. Amazon provides a Lambda layer for this specific library, that you simply can attach to your Lambda to use numpy.
When you add a layer to your function, just select the SciPy layer: