Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

配置时,运行wukong,robot包报错 #279

Open
xiashu4 opened this issue Jul 9, 2023 · 6 comments
Open

配置时,运行wukong,robot包报错 #279

xiashu4 opened this issue Jul 9, 2023 · 6 comments
Assignees
Labels
operation problem 用户操作问题

Comments

@xiashu4
Copy link

xiashu4 commented Jul 9, 2023

确认已寻找过答案

我已确认在 Github issue 页、常见问题页、文档 中都查找过,没有找到类似问题和资料。我也没有 google / bing/ 百度 / duckduckgo 到相关解答。

安装方式

手动安装/docker安装

操作系统

(例如 Raspbian Stretch、Ubuntu 16.04)

离线唤醒相关

如果是离线唤醒相关的问题,是否已确保 arecord temp.wavaplay temp.wav (Linux) 或 rec temp.wavplay temp.wav (Mac)已正常工作?(注意要求不能带任何其他参数)如果不能,请先配置好麦克风和音响再尝试。

—— 我已确保录音、播放都正常工作才尝试 wukong-robot 。

问题描述

具体说明下问题
配置时,输入python3 wukong-robot.py 后,报一长串错误,但我检查了是有文件的,类似:python3 wukong.py
Traceback (most recent call last):
File "/home/xy/Desktop/wukongrobot/wukong-robot-master/wukong.py", line 11, in
from robot.Conversation import Conversation

@xiashu4 xiashu4 added the operation problem 用户操作问题 label Jul 9, 2023
@wzpan
Copy link
Owner

wzpan commented Jul 10, 2023

python3 wukong-robot.py

这个脚本名字不对吧。是 python3 wukong.py 呀。

@xiashu4
Copy link
Author

xiashu4 commented Jul 10, 2023

对,我是TAB补全的,我把完整的报错信息贴出来

环境是虚拟机,ubuntu22.04

xy@xy-virtual-machine:~/Desktop/wukongrobot/wukong-robot-master$ python3 wukong.py
Traceback (most recent call last):
File "/home/xy/Desktop/wukongrobot/wukong-robot-master/wukong.py", line 11, in
from robot.Conversation import Conversation
File "/home/xy/Desktop/wukongrobot/wukong-robot-master/robot/Conversation.py", line 16, in
from robot.LifeCycleHandler import LifeCycleHandler
File "/home/xy/Desktop/wukongrobot/wukong-robot-master/robot/LifeCycleHandler.py", line 9, in
from watchdog.observers import Observer

@wzpan
Copy link
Owner

wzpan commented Jul 11, 2023

具体的错误没有给全。下面的具体错误信息是啥?请帖完整的log

@njtyair
Copy link

njtyair commented Mar 16, 2024

Traceback (most recent call last):
File "/home/parallels/work/wukong-robot/wukong.py", line 11, in
from robot.Conversation import Conversation
File "/home/parallels/work/wukong-robot/robot/Conversation.py", line 16, in
from robot.LifeCycleHandler import LifeCycleHandler
File "/home/parallels/work/wukong-robot/robot/LifeCycleHandler.py", line 9, in
from watchdog.observers import Observer
File "/home/parallels/.local/lib/python3.10/site-packages/watchdog/observers/init.py", line 63, in
from .inotify import InotifyObserver as Observer
File "/home/parallels/.local/lib/python3.10/site-packages/watchdog/observers/inotify.py", line 76, in
from watchdog.observers.api import (
File "/home/parallels/.local/lib/python3.10/site-packages/watchdog/observers/api.py", line 23, in
from watchdog.utils.bricks import SkipRepeatsQueue
File "/home/parallels/.local/lib/python3.10/site-packages/watchdog/utils/bricks.py", line 175, in
class OrderedSet(collections.MutableSet):
AttributeError: module 'collections' has no attribute 'MutableSet'

@ai408
Copy link

ai408 commented Jul 8, 2024

@njtyair 请问解决了吗?

@yiyexy
Copy link

yiyexy commented Dec 8, 2024

这个问题主要是由于你的python版本过高。
collections是python的基本模块,3.10中将这些类变换了位置,到了collection.abc下面:
image
image

解决办法也很简单:

  1. 降低python版本(感觉过于麻烦,不推荐)
  2. 这个错误主要是watchdog这个库,因此推荐如下方式:
  • 本地clone这个库:git clone https://github.com/gorakhargosh/watchdog.git
  • 进入这个库之后,修改库版本tag为0.9.0: git checkout tags/v0.9.0
  • 找到文件watchdog/src/watchdog/utils/bricks.py中第175行,修改为 class OrderedSet(collections.abc.MutableSet):
  • 在watchdog文件夹下,重新安装这个库:pip3 install .

问题解决~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
operation problem 用户操作问题
Projects
None yet
Development

No branches or pull requests

5 participants