I have a python package that I would like to upload to AWS Lambda.
The package works on two different machines with no dependencies issues at all.
However, when uploading the same folder to AWS Lambda, I get the following error:
Unable to import module 'tweet_analyzer_python/lambda_handler': No module named redis
Here is a list of the files in the package:
.
|-- event.json
|-- lambda_handler.py
|-- redis
| |-- client.py
| |-- client.pyc
| |-- _compat.py
| |-- _compat.pyc
| |-- connection.py
| |-- connection.pyc
| |-- exceptions.py
| |-- exceptions.pyc
| |-- __init__.py
| |-- __init__.pyc
| |-- lock.py
| |-- lock.pyc
| |-- sentinel.py
| |-- utils.py
| `-- utils.pyc
|-- redis-2.10.5-py2.7.egg-info
| |-- dependency_links.txt
| |-- installed-files.txt
| |-- PKG-INFO
| |-- SOURCES.txt
| `-- top_level.txt
|-- retrying-1.3.3-py2.7.egg-info
| |-- dependency_links.txt
| |-- installed-files.txt
| |-- PKG-INFO
| |-- requires.txt
| |-- SOURCES.txt
| `-- top_level.txt
|-- retrying.py
|-- retrying.pyc
|-- six-1.10.0-py2.7.egg-info
| |-- dependency_links.txt
| |-- installed-files.txt
| |-- PKG-INFO
| |-- SOURCES.txt
| `-- top_level.txt
|-- six.py
`-- six.pyc
For double-checking, I have downloaded the same zip file that was uploaded to AWS Lambda and put it on a clean linux machine.
When running:
python tweet_analyzer_python/lambda_handler
I had no issues at all.
Can someone explain me what am I doing wrong?
Thanks!