wzpan / wukong-robot

🤖 wukong-robot 是一个简单、灵活、优雅的中文语音对话机器人/智能音箱项目,支持ChatGPT多轮对话能力,还可能是首个支持脑机交互的开源智能音箱项目。

Home Page:https://wukong.hahack.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

新版 ModuleNotFoundError: No module named '_snowboydetect'

ZhouHr opened this issue · comments

$ python3 wukong.py
Traceback (most recent call last):
File "/data/service/wukong-robot/snowboy/snowboydetect.py", line 17, in swig_import_helper
return importlib.import_module(mname)
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 565, in module_from_spec
File "", line 1108, in create_module
File "", line 228, in _call_with_frames_removed
ImportError: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/data/service/wukong-robot/wukong.py", line 11, in
from robot.Conversation import Conversation
File "/data/service/wukong-robot/robot/Conversation.py", line 14, in
from snowboy import snowboydecoder
File "/data/service/wukong-robot/snowboy/snowboydecoder.py", line 5, in
from . import snowboydetect
File "/data/service/wukong-robot/snowboy/snowboydetect.py", line 21, in
_snowboydetect = swig_import_helper()
File "/data/service/wukong-robot/snowboy/snowboydetect.py", line 19, in swig_import_helper
return importlib.import_module("_snowboydetect")
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_snowboydetect'

编译_snowboydetect:

make
swig -I../../ -c++ -python -o snowboy-detect-swig.cc snowboy-detect-swig.i
g++ -I/usr/local/miniconda3/include/python3.4m -I/usr/local/miniconda3/include/python3.4m -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../../ -O3 -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++0x -c snowboy-detect-swig.cc
cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
^[[Og++ -I../../ -O3 -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++0x -shared snowboy-detect-swig.o
../..//lib/rpi/libsnowboy-detect.a -L/usr/local/miniconda3/lib -lpython3.4m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -lm -ldl -lf77blas -lcblas -llapack -latlas -o _snowboydetect.so

cp _snowboydetect.so wukong-robot/snowboy/

snowboy目录下存在_snowboydetect.so

已找到原因,是编译snowboy是的Python版本和运行时的版本不符合导致的问题