Announcement: The Alexa Skills Community Is Moving To Stack Overflow

For improved usability and experience, Alexa skills related forum support will be transitioned to Stack Overflow. Effective January 10, 2024, the Amazon Developer Forums will no longer be available. For continued Alexa skills support you can reach out to us on Stack Overflow or via Contact Us.

question

kensanderson avatar image
kensanderson asked

Can't run zipped python script as Lambda function

Inline code works fine, but when I zip my "skill.py" to "skill.zip", I get "errorMessage": "Unable to import module 'lambda_function' Any thoughts? Do I need the name the file some in particular?
alexa skills kitsubmission testing certification
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

memo@amazon avatar image
memo@amazon answered
Hi kensanderson , Zipped python code should work fine, but you have to make sure your file and function [b]match the Handler[/b] for your Lambda function. By default the Handler is set to, [i]lambda_function.lambda_handler[/i], you can check what your Handler is under the Configuration tab. if you were to stick with the default, your file should be named [b]lambda_function.py[/b] and your Python function should be named [b]lambda_handler[/b].
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kensanderson avatar image
kensanderson answered
Thank you!!! This is just what I needed to know!
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.