-
Notifications
You must be signed in to change notification settings - Fork 337
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
Having trouble importing validate from jsonschema #48
Comments
Hi, some things to check:
|
Thank you for your reply.
As for the other two points, it wasn't complaining that it couldn't find lambda. I commented out the lines wanting to validate the v3 json, and the code runs now. It just seemed like it could be a good idea to have that validation, just in case. (But since it's only code from Amazon's that I'm allowing inbound, I don't know how much of a risk it is.) Thank you for your time! It really seems like their example code should run 'out of the box' but I don't know enough Python and how it treats imports to really understand it. I spent quite a while trying to puzzle it out, but I don't have enough time right now and was hoping that for an expert it would just be obvious. Within the 'jsonschema' subfolder, there is a file 'validators.py' that contains the 'validate' method. There is a '__ init __.py' (no spaces, but the forum code was eating it and making the init render as bold) file in the jsonschema folder that has this: Here's the function, from the end of validators.py: def validate(instance, schema, cls=None, *args, **kwargs): So I really don't see why it would be failing. At least for now, I've given up on validation, until I can figure this out and fix it. |
I'm working my way through the guide here: https://github.com/alexa/alexa-smarthome/wiki/Build-a-Working-Smart-Home-Skill-in-15-Minutes
I have everything set up, and when I ask Alexa to discover devices, all I get is an error in the logs:
Unable to import module 'lambda': cannot import name 'validate'
If I change the Python version to 2.7 then it can't even find the module jsonschema. Is there some other thing that I'm doing wrong? I can provide plenty of extra details, but really, I just went step by step through that guide, and it's just not working, although I have everything connected, and was able to enable the skill from the Alexa app on my phone. (Also can do it through the web interface from my PC, but either way seems the same result. Python can't find that method for some reason.)
Thanks!
The text was updated successfully, but these errors were encountered: