Himanshu Yadav
Himanshu Yadav

Reputation: 13587

Aws Lambda: Python function with Pandas dependency

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?

Upvotes: 4

Views: 6348

Answers (2)

joarleymoraes
joarleymoraes

Reputation: 1949

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.

Upvotes: 3

Oluwafemi Sule
Oluwafemi Sule

Reputation: 38922

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.

Upvotes: 6

Related Questions