0
在嘗試運行樣本時,試圖完成大部分安裝直到結束。Google智能助理在RPi2上出現打印錯誤,失敗
python -m googlesamples.assistant.auth_helpers --client-secrets /home/pi/client_secret.json
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 151, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name)
File "/usr/lib/python3.4/runpy.py", line 118, in _get_module_details
return _get_module_details(pkg_main_name)
File "/usr/lib/python3.4/runpy.py", line 104, in _get_module_details
spec = importlib.util.find_spec(mod_name)
File "/usr/lib/python3.4/importlib/util.py", line 86, in find_spec
parent = __import__(parent_name, fromlist=['__path__'])
File "/home/pi/google/lib/python3.4/site-packages/googlesamples/assistant/auth_helpers/__init__.py", line 21, in <module>
import google.auth.transport.grpc
File "/home/pi/google/lib/python3.4/site-packages/google/auth/transport/grpc.py", line 20, in <module>
import grpc
File "/home/pi/google/lib/python3.4/site-packages/grpc/__init__.py", line 37, in <module>
from grpc._cython import cygrpc as _cygrpc
File "src/python/grpcio/grpc/_cython/cygrpc.pyx", line 32, in init grpc._cython.cygrpc (src/python/grpcio/grpc/_cython/cygrpc.c:28305)
File "/home/pi/google/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3036, in <module>
@_call_aside
File "/home/pi/google/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3020, in _call_aside
f(*args, **kwargs)
File "/home/pi/google/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3064, in _initialize_master_working_set
for dist in working_set
File "/home/pi/google/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3064, in <genexpr>
for dist in working_set
File "/home/pi/google/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2594, in activate
declare_namespace(pkg)
File "/home/pi/google/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2162, in declare_namespace
_handle_ns(packageName, path_item)
File "/home/pi/google/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2097, in _handle_ns
loader.load_module(packageName)
File "./google.py", line 42
print head,body,tail
SyntaxError: Missing parentheses in call to 'print'
鋸一個example其中一些已完成了工作,但它不是我清楚,如果他們使用python2或3 VENV?任何人都可以協助
我只是遵循python 3的命令行: https://developers.google.com/assistant/sdk/prototype/getting-started-pi-python/run-sample – ProZsolt
您是否創建了一個名爲google.py在你目前的目錄中?它可能與SDK使用的'google.assistant'命名空間衝突。 – proppy
感謝@proppy的捕獲。我有一個使用另一個谷歌API的舊腳本。由於我改變了名字,它的工作很好。 – JC23