I have downloaded a script from git into /tmp directory and I need to run the script in lambda. My handler looks like this:
def handler(event, context):
process = subprocess.run("/tmp/my_script.py", env = os.environ, stdout=None, stderr=subprocess.STDOUT)
However, my_script.py has some external dependencies, such as gevent.
# my_script.py
import gevent
...
When running in lambda, I got the following error:
ModuleNotFoundError: No module named 'gevent'
I have packaged the gevent module in the zipped file uploaded to lambda, which I believe they are under /var/task. How can I let my_script.py in /tmp directory know where to look for the dependencies?