aws
lambda
ai_generated
true
Runtime.ImportModuleError: Unable to import module 'handler'
ID: aws/lambda-runtime-error
94%Fix Rate
96%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
Lambda function cannot find the handler module — wrong handler path, missing dependencies, or wrong runtime.
genericWorkarounds
-
95% success Verify handler setting matches the file structure: module.function format
If handler.py has def main(), set handler to 'handler.main'
Sources: https://docs.aws.amazon.com/lambda/latest/dg/python-handler.html
-
92% success Ensure all dependencies are included in the deployment package or Lambda layer
pip install -t ./package -r requirements.txt then zip for deployment
Dead Ends
Common approaches that don't work:
-
Increasing Lambda memory/timeout
85% fail
Handler import is a packaging issue, not a resource issue
-
Changing the runtime version
70% fail
Rarely helps unless using runtime-specific syntax
Error Chain
Frequently confused with: