ask-alexa-pykit
ask-alexa-pykit copied to clipboard
VoiceHandler error when deploying to Lambda
When I attempt to deploy my very simple Alexa skill to Lambda and test it, I get the following error in the logs:
module initialization error: 'VoiceHandler' object has no attribute 'default'
What information can I provide to help troubleshoot?
I guess you implement Skill by reference to README.md.
$ pip install ask-alexa-pykit --target my_new_skill installs older(?) library.
You should open ask/alexa_io.py and search default_handler.
If match, you must replace your Alexa Skill default to default_handler, request to request_handler, intent to intent_handler.
It will be work.
Did you try what ysak recommended? I have some half finished dialogue management features on mainline. Try one of the stable releases.
I had the same problem when doing a
pip install ask-alexa-pykit --target pl_alex_test --upgrade
The PKGINFO for that read:
Metadata-Version: 1.0
Name: ask-alexa-pykit
Version: 0.5.6
Summary: Minimalist SDK for developing skills for Amazon's Alexa Skills Kit for Amazon Echo Dot Tap FireTV etc
Home-page: https://github.com/anjishnu/ask-alexa-pykit
Author: Anjishnu Kumar
Author-email: [email protected]
License: MIT
Description: UNKNOWN
Keywords: alexa,amazon echo,ask,ask-alexa-pykit,skill
Platform: UNKNOWN
It is noted on the homepage that:
For a stable release, check out the 0.5.6 branch
Following the instructions @ysak-y provided did resolve the problem (and helped me to better understand the way that the @ symbol works in Python!).
Note that when I grabbed a copy of the files from master and tried out the examples, I got a different error about default requiring 2 parameters -- self and func. I switched back to the 0.5.6 version installed via pip, applied @ysak-y's instructions and it worked fine.
Just in case anyone else missed it.
@alexa.default()
def default_handler(request):
should change to
@alexa.default_handler()
def default_handler(request):
etc etc. in your python scripts, the method name itself isn't relevant to this issue.