Closed nidhinnyc closed 4 years ago
It doesn't look like you're mounting your hello_world
directory at /var/task
.
Lambda looks for the modules at the top-level.
So try:
docker run --rm -v \
/Users/nidhinsurendran/Dev/pythonsamaws/hello_world:/var/task:ro,delegated \
lambci/lambda:python3.8 \
app.lambda_handler
@mhart , thanks a lot that worked.
When I try to run lambda using the below command it gives the error unable to import the module. If I get inside the container and check the /var/task folder I can see the files in the folder.
command
docker run --rm -v /Users/nidhinsurendran/Dev/pythonsamaws:/var/task:ro,delegated lambci/lambda:python3.8 app.lambda_handler
Error
{"errorType":"Runtime.ImportModuleError","errorMessage":"Unable to import module 'app': No module named 'app'"}
Template and folder![image](https://user-images.githubusercontent.com/17888632/89116636-f1d93580-d4b3-11ea-90c7-276217a6ba0a.png)
Has anyone encountered this issue?