AWS Lambda with Pandas and NumPy

Ruslan Korniichuk
Feb 21 · 3 min read

Problem statement

Unable to import module 'lambda_function': No module named 'pandas'
$ pip install -t . pandas
$ rm -r *.dist-info __pycache__
$ zip -r zip.zip .
zip.zip archive with lambda_function.py file and Pandas
Upload function package
Unable to import module 'lambda_function': Missing required dependencies ['numpy']
zip.zip archive with lambda_function.py file, Pandas, and Numpy
$ rm -r pandas numpy *.dist-info

Solution

$ unzip numpy-1.16.1-cp36-cp36m-manylinux1_x86_64.whl
$ unzip pandas-0.24.1-cp36-cp36m-manylinux1_x86_64.whl
$ rm -r *.whl *.dist-info __pycache__
$ zip -r zip.zip .
zip.zip archive for Amazon Linux with lambda_function.py file, Pandas, and Numpy
Upload function package
Execution result: succeeded

Ruslan Korniichuk

Written by

Python Developer and AI Engineer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade