Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce the size of packaged python zip files for AWS Lambda

Afternoon,

I recently came across AWS Lambda and Azure Functions. AWS imposes a limit on the size of zipped as well as unzipped files, which for python scripts need to include all of the dependent modules. I have been using lambda-uploader to package my script and it's module dependencies, but the pandas package is too big.

I have seen examples of people completing machine learning and using pandas on AWS Lambda (a little outdated though) but I can't see how they're doing it. Any suggestions?

like image 779
Hendrix Avatar asked Mar 30 '18 02:03

Hendrix


Video Answer


1 Answers

If you're using Python libraries, you can get rid of botocore, boto3 as they are already present in AWS's lambdas functions.

like image 68
Yassine Boujida Avatar answered Oct 11 '22 14:10

Yassine Boujida