ask-alexa-pykit icon indicating copy to clipboard operation
ask-alexa-pykit copied to clipboard

VoiceHandler error when deploying to Lambda

Open mwheeler1982 opened this issue 8 years ago • 4 comments
trafficstars

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?

mwheeler1982 avatar Dec 26 '16 03:12 mwheeler1982

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.

ysak-y avatar Dec 27 '16 15:12 ysak-y

Did you try what ysak recommended? I have some half finished dialogue management features on mainline. Try one of the stable releases.

anjishnu avatar Jan 05 '17 07:01 anjishnu

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.

planux avatar Mar 13 '17 05:03 planux

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.

mickster04 avatar Jun 18 '17 22:06 mickster04