0

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.

asked May 18, 2021 at 12:25
2
  • Can you share the project structure here? Commented 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. Commented May 18, 2021 at 12:31

1 Answer 1

2

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:

scipy-aws-lambda-layer

answered May 18, 2021 at 14:19
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.