I am trying to import a python deployment package in aws lambda. The python code uses numpy. I followed the deployment package instructions for virtual env but it still gave
The easiest way is to use AWS Cloud9, there is no need to start EC2 instances and prepare deployment packages.
go to the Application folder, for me this is
cd App
install the package (we have to use pip from the virtual environment, because the default pip points to /usr/bin/pip and this is python 2.7)
venv/bin/pip install numpy -t .
you can test the installation by editing the lambda_function.py file:
import numpy as np
def lambda_handler(event, context):
return np.sin(1.0)
save the changes and click the green Run button on the top of the screen
after the Lambda executes I get:
Response
0.8414709848078965
the Lambda function should be visible, the name has the format
cloud9-ApplicationName-FunctionName-RandomString