我遇到了这个问题,我需要使用sudo
命令运行google assistant sdk,因为我在使用https://github.com/emutex/GrovePi的Grovepi库接收到指令后尝试集成操作。
如果我没有使用sudo
的google助手sdk运行,我会收到错误```
(env) ubilinux@ubilinux4:~/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/library$ python project.py --device_model_id **************
Traceback (most recent call last):
File "project.py", line 26, in <module>
from grovepi import *
File "/home/ubilinux/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/library/grovepi.py", line 98, in <module>
import RPi.GPIO as GPIO
ImportError: No module named 'RPi'
```
这是我用sudo
运行命令时得到的错误```
(env) ubilinux@ubilinux4:~/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/library$ sudo python project.py --device_model_id *****************************
[sudo] password for ubilinux:
Traceback (most recent call last):
File "project.py", line 23, in <module>
import google.auth.transport.requests
ImportError: No module named google.auth.transport.requests
```
project.py代码与默认的hotwords.py源代码相同,但我只是在代码中加上from grovepi import *
来导入grovepi库。
请帮帮我:( 提前致谢