How to deploy to python function which has the dependency on external libraries?
For example, I am trying to deploy to a data-analysis python function. When I try to test the python function from the lambda console, I get:
Unable to import module 'lambda_function': No module named pandas
I am totally new to Aws Lambda
Is there a linux box on which Lambda functions run where I can install these libraries?
You need to create a deployment package as detailed here: http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html#deployment-pkg-for-virtualenv
This just means bundling the contents of site-packages for the environment you're developing on into the deployment package together with the lambda python script into a zip that is uploaded.
If you new to Lambda deployment, you might want check this tutorial (I wrote), which covers the most common pitfalls. And gives you a script as well to automate the entire process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With