Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VoiceHandler error when deploying to Lambda #30

Open
mwheeler1982 opened this issue Dec 26, 2016 · 4 comments
Open

VoiceHandler error when deploying to Lambda #30

mwheeler1982 opened this issue Dec 26, 2016 · 4 comments

Comments

@mwheeler1982
Copy link

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?

@ysak-y
Copy link
Contributor

ysak-y commented Dec 27, 2016

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.

@anjishnu
Copy link
Owner

anjishnu commented Jan 5, 2017

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

@planux
Copy link

planux commented Mar 13, 2017

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.

@mickster04
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants