AWS Lambda with Pandas and NumPy

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

--

--

--

Python Developer and Artificial Intelligence Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ruslan Korniichuk

Ruslan Korniichuk

Python Developer and Artificial Intelligence Engineer

More from Medium

Python Environment Setup in AWS

Load CSV Data Into Elasticsearch Using Python

Setting up Python Interpreter and running Python Code on Docker Container

Python and REST APIs