lambda-layers-demo icon indicating copy to clipboard operation
lambda-layers-demo copied to clipboard

sam local invoke doesn't work

Open CJohnsonLehi opened this issue 5 years ago • 1 comments

I cloned the git repo on windows and on my mac. Running on Python 3.7.3.

Executing sam local invoke DeserializeDemoFunction failed with:

Invoking main.lambda_handler (python3.7)
MyLambdaLayer is a local Layer in the template
Building image...
Requested to skip pulling images ...

Mounting C:\code\github\lambda-layers-demo\deserialize-demo as /var/task:ro,delegated inside runtime container
?[32mSTART RequestId: d31162d0-d9f6-1806-6137-12c472e6542e Version: $LATEST?[0m
[ERROR] Runtime.ImportModuleError: Unable to import module 'main': No module named 'deserialize'
?[32mEND RequestId: d31162d0-d9f6-1806-6137-12c472e6542e?[0m
?[32mREPORT RequestId: d31162d0-d9f6-1806-6137-12c472e6542e     Init Duration: 279.32 ms        Duration: 4.90 ms       Billed Duration: 100 ms Memory Size: 128 MB     Max Memory Used: 32 MB  ?[0m

{"errorType":"Runtime.ImportModuleError","errorMessage":"Unable to import module 'main': No module named 'deserialize'"}

CJohnsonLehi avatar Feb 27 '20 16:02 CJohnsonLehi

In your logs it says [ERROR] Runtime.ImportModuleError: Unable to import module 'main': No module named 'deserialize' This means sam isn't able to locate the main.py file, make sure you gave the right path. Double-check the spelling of the 'deserialize' as well

Aditya-Rajgor avatar Oct 29 '21 04:10 Aditya-Rajgor