When installing Google Assistant, I an error "...googlesamples.assistant' is a package and cannot be directly executed..."

robmak3 picture robmak3 · May 21, 2017 · Viewed 14.3k times · Source

Alright, have been installing Google Assistant on my Windows 10 PC and have been met with multiple errors, the last of which I solved by going here: Google Assistant Installation on Python3.6 OSX

Now, I have everything installed, and want to test my mic and then start using the assistant. However, when I put in the commands

python -m googlesamples.assistant.audio_helpers 

and

python -m googlesamples.assistant

I get this error:

C:\Users\robmak3>python -m googlesamples.assistant
C:\Users\robmak3\AppData\Local\Programs\Python\Python36\python.exe: No 
module named googlesamples.assistant.__main__; 'googlesamples.assistant' is 
a package and cannot be directly executed

I've been trying to follow this guide: https://www.xda-developers.com/how-to-get-google-assistant-on-your-windows-mac-or-linux-machine/

Any help fixing this would be great! Thanks!

Answer

proppy picture proppy · May 21, 2017

As per version 0.3.0 of the SDK the gRPC samples are using a different auth helpers.

pip install --upgrade google-auth-oauthlib[tool]
google-oauthlib-tool --client-secrets path/to/client_secret_XXXXX.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless

And you can launch the update gRPC sample with:

python -m googlesamples.assistant.grpc.pushtotalk

You should be able to follow the instructions from the SDK package and gRPC package page and explore the reference sample