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

Running in Debian #689

Open
jaggzh opened this issue Jul 2, 2023 · 6 comments
Open

Running in Debian #689

jaggzh opened this issue Jul 2, 2023 · 6 comments

Comments

@jaggzh
Copy link

jaggzh commented Jul 2, 2023

(Debian testing was now moved to Stable. Version Debian 12.)

Something's wrong with the snowball. I've tried building snowball myself as well. (See second log output).
I'm running in a venv (not a conda), so it uses the system python version 3.11.

Exception in thread <class 'kalliope.signals.order.order.Order'>:
Traceback (most recent call last):
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/trigger/snowboy/snowboydetect.py", line 26, in swig_import_helper
    fp, pathname, description = imp.find_module(module_file_path, [dirname(__file__)])
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'x86_64/python311/_snowboydetect'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/signals/order/order.py", line 89, in run
    self.start_trigger()
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 402, in trigger
    return self.machine._process(func)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 1223, in _process
    self._transition_queue[0]()
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 416, in _trigger
    self._process(event_data)
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 439, in _process
    if trans.execute(event_data):
       ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 277, in execute
    self._change_state(event_data)
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 287, in _change_state
    event_data.machine.get_state(self.dest).enter(event_data)
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 129, in enter
    event_data.machine.callbacks(self.on_enter, event_data)
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 1146, in callbacks
    self.callback(func, event_data)
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/transitions/core.py", line 1167, in callback
    func(*event_data.args, **event_data.kwargs)
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/signals/order/order.py", line 96, in start_trigger_process
    self.trigger_instance = TriggerLauncher.get_trigger(settings=self.settings, callback=self.trigger_callback)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/core/TriggerLauncher.py", line 32, in get_trigger
    trigger_instance = Utils.get_dynamic_class_instantiation(package_name="trigger",
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/core/Utils/Utils.py", line 135, in get_dynamic_class_instantiation
    mod = __import__(package_path, fromlist=[module_name.capitalize()])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/trigger/snowboy/__init__.py", line 1, in <module>
    from .snowboy import Snowboy
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/trigger/snowboy/snowboy.py", line 6, in <module>
    from kalliope.trigger.snowboy import snowboydecoder
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/trigger/snowboy/snowboydecoder.py", line 7, in <module>
    from . import snowboydetect
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/trigger/snowboy/snowboydetect.py", line 36, in <module>
    _snowboydetect = swig_import_helper()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/home/jaggz/venvs/kalliope/lib/python3.11/site-packages/kalliope/trigger/snowboy/snowboydetect.py", line 28, in swig_import_helper
    import _snowboydetect
ModuleNotFoundError: No module named '_snowboydetect'
Starting REST API Listening port: 5000
Starting Kalliope
Press Ctrl+C for stopping
Starting order signal


Ctrl+C pressed. Killing Kalliope

Snowball install seems to go okay:

(kalliope) 08h15m wj|~/opt/src/voice/voice-assistant/kalliope-snowboy
$ pip install .
Processing /home/brandon/opt/src/voice/voice-assistant/kalliope-snowboy
  Preparing metadata (setup.py) ... done
Requirement already satisfied: PyAudio in /home/brandon/venv/kalliope/lib/python3.11/site-packages (from snowboy==1.3.0) (0.2.13)
Building wheels for collected packages: snowboy
  Building wheel for snowboy (setup.py) ... done
  Created wheel for snowboy: filename=snowboy-1.3.0-py3-none-any.whl size=17436362 sha256=a46f468ccfecd71e419d4809e27fe6addafd09ac1ef45bfe178061f332f296c0
  Stored in directory: /home/brandon/.cache/pip/wheels/9b/3d/cf/8575f4874cb5545b47c7eaab4dba15505f0b6fe34ec0750365
Successfully built snowboy
Installing collected packages: snowboy
  Attempting uninstall: snowboy
    Found existing installation: snowboy 1.3.0
    Not uninstalling snowboy at /home/brandon/opt/src/voice/voice-assistant/kalliope-snowboy, outside environment /home/brandon/venv/kalliope
    Can't uninstall 'snowboy'. No files were found to uninstall.
Successfully installed snowboy-1.3.0
@jaggzh
Copy link
Author

jaggzh commented Jul 2, 2023

Okay, I do see we have these:

(kalliope) 08h19m wj|~/opt/src/voice/voice-assistant/kalliope/kalliope/trigger/snowboy/x86_64                                                     
$ d                                                                      
drwxr-xr-x 2 4096 Jul  2 07:41 python36
drwxr-xr-x 2 4096 Jul  2 07:41 python37
drwxr-xr-x 2 4096 Jul  2 07:41 python38
drwxr-xr-x 2 4096 Jul  2 07:41 python39

But I don't yet see how we go about building them.

@jaggzh
Copy link
Author

jaggzh commented Jul 2, 2023

Okay, got it. Copied my built _snowboydetect.so into a python311/ dir.
Do you guys need a copy of my .so? (It might be more security-conscious to have a lead dev be the contributor of it, being harder for an .so to be reviewed for safety).

@cprn
Copy link

cprn commented Dec 11, 2023

I think the actual fix for this would be to add docker/snowboy-compile/compile_snowboy_python311.dockerfile...?

@F-Fichter
Copy link

Is python 3.11 is ok now ?

@cprn
Copy link

cprn commented May 27, 2024

Is python 3.11 is ok now ?

No, it still doesn't compile snowboy for Python version 3.11. The newest fork was updated 2023-04-04 and it doesn't compile it for 3.11 either, only 3.6 to 3.9. Other than that, there's an older fork from @jaggzh who compiled 3.11 a few comments above so you can use his (but as he mentioned himself, files from strangers can potentially contain malware) but beware, according to merge request, it's not up to date.

@Sispheor
Copy link
Member

You'll find in issues a way to compile Snowboy with a new Python version.

We should have changed the trigger engine long time ago...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants