Closed codito closed 4 years ago
Hi, we follow the development of required lib. So no plan to update until all of them support it.
Any updates on this? Any workaround to run kalliope with python3 on Raspberry Pi?
Python 3 is already supported. We haven't tested Python 3.7.
Also on RPi? I am always getting errors about snowboy after a clean install in my virtual environment (under python2 environment everything works fine)
You need to recompile snowboy maybe. But it should be fine. The binary is made for arm
I think we only need to build snowboy for this one and add the binary like for other Python version.
Hi!
I myself have problems to migrate from Python 2 to Python 3 on Raspberry Pi.
I managed all problems (building Python 3.6, etc) but snowboy: impossible to do a clean install from pip3 and even a manual install of snowboy didn't solved the problem : i always have the error "ModuleNotFoundError: No module named '_snowboydetect'".
EDIT : when looking for kalliope github repo, I didn't see a file "trigger/snowboy/armv7l/python36/_snowboydetect.so" and maybe it is the problem. I tried to copy a "_snowboydetect.so" file from a snowboy install, and i get another strange error :
...
File "/usr/local/lib/python3.6/site-packages/kalliope/trigger/snowboy/snowboydetect.py", line 30, in <module>
_snowboydetect = swig_import_helper()
File "/usr/local/lib/python3.6/site-packages/kalliope/trigger/snowboy/snowboydetect.py", line 26, in swig_import_helper
_mod = imp.load_module('_snowboydetect', fp, pathname, description)
File "/usr/local/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/local/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dynamic module does not define module export function (PyInit__snowboydetect)
Of course, after hours of searching and finally deciding to speak here, i found a workaround in a last try...
This solved my problem, no more error when launching kalliope (will verify later that all is working at home) :
git clone https://github.com/Kitt-AI/snowboy.git
cd snowboy/swig/Python3
make
sudo mkdir -p /usr/local/lib/python3.6/site-packages/kalliope/trigger/snowboy/armv7l/pyathon36/
sudo cp _snowboydetect.so /usr/local/lib/python3.6/site-packages/kalliope/trigger/snowboy/armv7l/pyathon36/
rm -Rf ~/snowboy
With python 3.7 it still has problems, mainly because currently snowboy is a bit broken, i recommend building it yourself from NicoHoods fix, it works for me https://github.com/NicoHood/snowboy/tree/python3_fix
Build it using make in the folder python3 and copy the files over and it should work
It was a general problem with Hotword, _snowboydetect.so needs to be in the same directory as snowboydetect.py
It woks on my side as it. On Ubuntu 18.04 with x86_64 procesor
im using a Ubuntu MATE 19.04 x86_64 VirtualBox VM
Did you test with the branch "raspbian_buster" which fix Python 3.7? This one is in pending review. Will be merged in dev soon.
not yet, but will try
I've tried it and i'm this error:
Starting REST API Listening port: 5000
Starting Kalliope
Press Ctrl+C for stopping
Starting order signal
I'm ready
Exception in thread <class 'kalliope.signals.order.order.Order'>:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/home/omegarogue/projects/kalliope/kalliope/signals/order/order.py", line 87, in run
self.start_trigger()
File "/home/omegarogue/projects/kalliope/.venv/lib/python3.7/site-packages/transitions/core.py", line 405, in trigger
return self.machine._process(func)
File "/home/omegarogue/projects/kalliope/.venv/lib/python3.7/site-packages/transitions/core.py", line 1086, in _process
self._transition_queue[0]()
File "/home/omegarogue/projects/kalliope/.venv/lib/python3.7/site-packages/transitions/core.py", line 423, in _trigger
return self._process(event_data)
File "/home/omegarogue/projects/kalliope/.venv/lib/python3.7/site-packages/transitions/core.py", line 433, in _process
if trans.execute(event_data):
File "/home/omegarogue/projects/kalliope/.venv/lib/python3.7/site-packages/transitions/core.py", line 283, in execute
self._change_state(event_data)
File "/home/omegarogue/projects/kalliope/.venv/lib/python3.7/site-packages/transitions/core.py", line 294, in _change_state
event_data.machine.get_state(self.dest).enter(event_data)
File "/home/omegarogue/projects/kalliope/.venv/lib/python3.7/site-packages/transitions/core.py", line 140, in enter
event_data.machine.callback(handle, event_data)
File "/home/omegarogue/projects/kalliope/.venv/lib/python3.7/site-packages/transitions/core.py", line 1031, in callback
func(*event_data.args, **event_data.kwargs)
File "/home/omegarogue/projects/kalliope/kalliope/signals/order/order.py", line 95, in start_trigger_process
self.trigger_instance = TriggerLauncher.get_trigger(settings=self.settings, callback=self.trigger_callback)
File "/home/omegarogue/projects/kalliope/kalliope/core/TriggerLauncher.py", line 37, in get_trigger
resources_dir=trigger_folder)
File "/home/omegarogue/projects/kalliope/kalliope/core/Utils/Utils.py", line 126, in get_dynamic_class_instantiation
mod = __import__(package_path, fromlist=[module_name.capitalize()])
File "/home/omegarogue/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/192.6817.19/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/omegarogue/projects/kalliope/kalliope/trigger/snowboy/__init__.py", line 1, in <module>
from .snowboy import Snowboy
File "/home/omegarogue/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/192.6817.19/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/omegarogue/projects/kalliope/kalliope/trigger/snowboy/snowboy.py", line 6, in <module>
from kalliope.trigger.snowboy import snowboydecoder
File "/home/omegarogue/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/192.6817.19/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/omegarogue/projects/kalliope/kalliope/trigger/snowboy/snowboydecoder.py", line 7, in <module>
from . import snowboydetect
File "/home/omegarogue/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/192.6817.19/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/omegarogue/projects/kalliope/kalliope/trigger/snowboy/snowboydetect.py", line 30, in <module>
_snowboydetect = swig_import_helper()
File "/home/omegarogue/projects/kalliope/kalliope/trigger/snowboy/snowboydetect.py", line 26, in swig_import_helper
_mod = imp.load_module('_snowboydetect', fp, pathname, description)
File "/usr/lib/python3.7/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
I just created a fresh venv with 3.7 and I don't have the issue.
Did you install the package python3-dev
like explained in the doc?
yes, a few kalliope installs ago
Ok, I don't know then. This lib comes with this package. BTW you can use the gitter chat to get some help from the community.
Ok, here is my solution. I switched Kalliope to Python3.7 from Python 2.7 just today and I had to solve the same problem. My solution for Raspian Buster on RPi3 is following:
pip3 install -U kalliope
apt install swig libatlas-base-dev
git clone https://github.com/Kitt-AI/snowboy.git
cd snowboy/swig/Python3
make
mkdir /usr/local/lib/python3.7/dist-packages/kalliope/trigger/snowboy/armv7l/python37
cp _snowboydetect.so /usr/local/lib/python3.7/dist-packages/kalliope/trigger/snowboy/armv7l/python37/
and thats all. Now Kalliope is running fine.
This issue has been fixed and merged in the last release. Should be ok with kalliope 0.5.5
Any plans to add support for python 3.7?