I'm using the Google Assistant Python Library on my Raspberry Pi 3. After getting the google-assistant-demo to work in a Python Virtual Environment, I want to start my own project. The reference tells something about the script google.assistant.assistant, which contains functions like start(), but I can't find it. How can I access them?
Asked
Active
Viewed 590 times
2 Answers
0
did you :
Next steps
You are now ready to start your own project:
git clone https://github.com/googlesamples/assistant-sdk-python $ cp
-r assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/library new-project
See Next Steps for more information on customizing Google Assistant events and actions.

Eric Parisot
- 31
- 6
-
Yes, this is exactly what I did. Now I figured out I can import the library with "from google.assistant.library import Assistant". But when I execute the script it says there is no such module, but I'm pretty sure everything is installed correctly. – Jan Jun 11 '17 at 09:24
0
So when you cloned the GitHub, it creates a new folder called "new-project" (or whatever) containing the library and a sample script called hotword.py where you can see :
from __future__ import print_function
import argparse
import os.path
import json
import google.oauth2.credentials
from google.assistant.library import Assistant
from google.assistant.library.event import EventType
from google.assistant.library.file_helpers import existing_file
So it looks a little bit more complex than just a one row import ... From where do you run your script ?

Eric Parisot
- 31
- 6
-
Yes, but the problem was that none of these modules could be found. Just found a solution by making a python virtual environment and starting the script from there. Now python can find the modules, but I'm running into another really stupid problem. As the reference says, you should use the Assistant as a ContextManager, and for this I need to pass an argument called "credentials". I don't know where to find my credentials. May be a stupid question, but maybe you could help me out there? – Jan Jun 11 '17 at 09:47
-
-
All the problems I had was because of relative paths... this Venv stuff is tricky for it... – Eric Parisot Jun 11 '17 at 11:27