安装Google智能助理时,我出现错误" ... googlesamples.assistant'是一个包,不能直接执行..."

时间:2017-05-20 22:06:00

标签: python windows google-assistant-sdk google-assist-api

好吧,我一直在我的Windows 10 PC上安装Google智能助理,但遇到了多个错误,最后一个问题我在这里解决了:Google Assistant Installation on Python3.6 OSX

现在,我安装了所有东西,想要测试我的麦克风,然后开始使用助手。但是,当我输入命令时

python -m googlesamples.assistant.audio_helpers 

python -m googlesamples.assistant

我收到此错误:

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

我一直在尝试遵循本指南:https://www.xda-developers.com/how-to-get-google-assistant-on-your-windows-mac-or-linux-machine/

任何帮助解决这个问题都会很棒!谢谢!

2 个答案:

答案 0 :(得分:10)

根据SDK的0.3.0版本,gRPC示例使用不同的auth帮助程序。

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

您可以使用以下命令启动更新gRPC示例

python -m googlesamples.assistant.grpc.pushtotalk

您应该可以按照SDK packagegRPC package页面上的说明操作,并浏览参考sample

答案 1 :(得分:1)

请尝试使用此命令:

python -m googlesamples.assistant.grpc.audio_helpers

如果您转到以下路径,您会注意到助手目录中有一个名为grpc的目录。

  

C:\用户\%的用户名%\应用程序数据\本地\程序\蟒\ python36-32 \ lib中\站点包\ googlesamples \助理\

这就是为什么你需要在助手旁边添加.grpc。在grpc目录中,你可以看到audio_helpers.py脚本。

要启动Google智能助理,请输入以下命令:

python -m googlesamples.assistant.grpc.pushtotalk

enter image description here

enter image description here