rhasspy / rhasspy-wake-raven

Wake word detection engine based on Snips Personal Wakeword Detector
MIT License
45 stars 5 forks source link

No module named 'rhasspywake_raven.dtw' #8

Open lukifer opened 3 years ago

lukifer commented 3 years ago

Trying to install on Rpi 4 (latest Raspian/RpiOS), everything seems successful, but getting the following error when running bin/rhasspy-wake-raven:

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.7/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/pi/rhasspy-wake-raven/rhasspywake_raven/__init__.py", line 13, in <module>
    from .dtw import DynamicTimeWarping
ModuleNotFoundError: No module named 'rhasspywake_raven.dtw'

pip install dtw definitely works, tried on both arm64 and armv7l OS's. Any ideas?

maxbachmann commented 3 years ago

This is caused by the new C module dtw which is part of rhasspywake_raven. This module is compiled and installed next to the Python files. However when running bin/rhasspy-wake-raven it appears Python is not importing the installed files, but directly imports the files in the rhasspywake_raven directory. Since this directory does not provide the compiled version of the dtw module it fails to run. @synesthesiam do you know a way to tell Python to use the installed module even when there is a directory with the same name in the current working directory?

synesthesiam commented 3 years ago

One way that seems to work for me has been added to the create-venv.sh script (after installing requirements):

python3 setup.py build_ext --inplace
maxbachmann commented 3 years ago

Yes, I guess this should work around the problem.