我有一个google aiyproject voice kit。我有设置身份验证,并且从终端运行脚本时一切正常,例如./example.py
。我配置了与systemctl服务相同的脚本,并且在启动时出现此错误。
Feb 26 20:27:47 raspberrypi python3[933]: To use the Assistant API, manually start the application from the dev terminal.
Feb 26 20:27:47 raspberrypi python3[933]: See the "Turn on the Assistant API" section of the Voice Recognizer
Feb 26 20:27:47 raspberrypi python3[933]: User's Guide for more info.
我看到这段代码here
if not os.getenv('DISPLAY') and not sys.stdout.isatty():
print("""
To use the Assistant API, manually start the application from the dev terminal.
See the "Turn on the Assistant API" section of the Voice Recognizer
User's Guide for more info.""")
sys.exit(1)
我对python不太熟悉,想知道为什么它不能作为服务运行。 auth令牌保存在文件中,无需交互。有没有办法我可以做到这一点。我的要求是在系统启动时,助手程序应以无头模式自动启动。