小编Chr*_*son的帖子

没有名为 pathlib2 的模块

我一直在努力让 Google Assistant 在我的 Raspberry Pi 3 上工作。它正在工作,但我在让这个特定步骤工作时遇到问题:https : //developers.google.com/assistant/sdk/guides/library/蟒蛇/扩展/句柄设备命令

此步骤包括向 Pi 发送开/关命令以打开或关闭 LED 灯泡。我已经确认面包板和 LED 设置正确,因为我可以通过 python 脚本打开或关闭 LED。

但是,按照该页面中的步骤并尝试运行以下命令“python hotword.py --device_model_id my-model”(实际上是:python hotword.py --device_model_id assistantraspi-1d671-pigooglev2-8n98u3)后,我得到以下错误:ImportError: No module named pathlib2

我包含了该文件的副本 (hotword.py)

#!/usr/bin/env python

# Copyright (C) 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
# …
Run Code Online (Sandbox Code Playgroud)

python json argparse pathlib google-assistant-sdk

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

argparse ×1

google-assistant-sdk ×1

json ×1

pathlib ×1

python ×1