I created 2 Lambda Functions from AWS Resources menu in Cloud9.
I wanna have common modules for these Functions.
I made New Folder for the common modules and add the path ~/environment/python/lib
to PYTHONPATH of Preferences -> Python Support.
I did Run
main function with Lambda(local)
.
But I got Unable to import module 'main/lambda_function': No module named 'common'
.
Can I set up PYTHONPATH for Lambda Function in Cloud9?
Or is there a better practice for having common modules for several Lambda Functions?
My folder tree:
root
|-python
|-lib <- for uploading to Lambda Layers
common.py
|-app
|-main
|-lambda_function.py
|-main2
|-lambda_function.py
my lambda_function.py:
import common