.async语法错误,在树莓派安装谷歌助手sdk



我正在使用python 3.7.3版本,我得到一个语法错误。

(env) pi@raspberrypi: $ googlesamples-assistant-pushtotalk-project-id ***** --device-model-id ********
Traceback (most recent call last):
File "/home/pi/env/bin/googtesamples assistant-pushtotalk", line 5, in from googlesamples.assistant.grpc.pushtotalk import main
File "/home/pi/env/Lib/python3.7/site-packages/googlesamples/assistant/grpc/pushtotalk.py", line 29, in
from tenacity import retry, stop_after_attempt, retry if exception
File "/home/pi/env/lib/python3.7/site-packages/tenacity/ init__.py", line 292
from tenacity.async import AsyncRetrying
SyntaxError: invalid syntax

我在尝试使用一键通命令时也有同样的问题。我还尝试通过使用

来解决这个问题。
pip install -U tenacity

但是我得到了另一个错误:没有这样的选项——project-id

经过快速的研究,我得出了这样的解决方案:

// upgrade google-assistant-library
$ python3 -m pip install --upgrade google-assistant-library
//Run the demo
google-assistant-demo --project-id PROJECT_ID --device-model-id DEVICE_MODEL

然后你可以使用像Ok Google或Hey Google这样的热词,它就像一个魅力。

希望这对你也有用。

原文:https://github.com/googlesamples/assistant-sdk-python/issues/411

最新更新