I've been trying to run my code in AWS Lambda which imports pandas. So here is what I've done.
I have a python file which contains a simple code as follows(This file has the lambda handler)
import json
print('Loading function')
import pandas as pd
def lambda_handler(event, context):
return "Welcome to Pandas usage in AWS Lambda"
- I have zipped this python file along with numpy, pandas and pytz libraries as a deployment package (Did all these in Amazon EC2 linux machine)
- Then uploaded the package into S3
- Created a lambda function(runtime=python3.6) and uploaded the deployment package from S3
But when I test the lambda function in AWS Lambda, I get the below error:
Unable to import module 'lambda_function': Missing required dependencies ['numpy']
I already have numpy in the zipped package but still I get this error. I tried to follow the hints given at Pandas & AWS Lambda but no luck.
Did anyone ran into the same issue. Would appreciate any hint or suggestions to solve this problem.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…