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

ImportError: dynamic module does not define init function (PyInit__snowboydetect) #3

Closed
wupanhao opened this issue May 14, 2017 · 8 comments

Comments

@wupanhao
Copy link

wupanhao commented May 14, 2017

(env) pi@raspberrypi:~/google-assistant-hotword-raspi $ python gassistant.py models/ok_google.pmdl

I run on my raspberry pi 2 , but get this error

(env) pi@raspberrypi:~/google-assistant-hotword-raspi $ python gassistant.py models/ok_google.pmdl
Traceback (most recent call last):
  File "/home/pi/google-assistant-hotword-raspi/snowboydetect.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "<frozen importlib._bootstrap>", line 539, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1715, in load_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
ImportError: dynamic module does not define init function (PyInit__snowboydetect)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gassistant.py", line 1, in <module>
    import snowboydecoder
  File "/home/pi/google-assistant-hotword-raspi/snowboydecoder.py", line 5, in <module>
    import snowboydetect
  File "/home/pi/google-assistant-hotword-raspi/snowboydetect.py", line 21, in <module>
    _snowboydetect = swig_import_helper()
  File "/home/pi/google-assistant-hotword-raspi/snowboydetect.py", line 20, in swig_import_helper
    return importlib.import_module('_snowboydetect')
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: dynamic module does not define init function (PyInit__snowboydetect)
@phdemartin
Copy link

Same problem here on Rri 3

@warchildmd
Copy link
Owner

The snowboy.so in this repo is for Python 2.x only.

@ardx160
Copy link

ardx160 commented Jun 21, 2017

Same problem here, any solution for this error? I'm using Raspberry Pi 3, with virtual environment for Python 3

@Andy1314Chen
Copy link

Andy1314Chen commented Aug 25, 2017

sad! I have the same problem...
python3 , raspberry pi3

@Moulde
Copy link

Moulde commented Sep 13, 2017

I don't quite understand this.
The guide in the readme clearly shows the way to create python virtual envs for both python 2.7 and 3.
And shows how to rename the _snowboydetect.so, but the the final script to run, doesn't support python 3? That's a bit odd :(

@warchildmd
Copy link
Owner

#9 added snowboy for Py3. Thanks to @Shaxine

@Shaxine
Copy link
Contributor

Shaxine commented Sep 16, 2017

@Moulde Since the last commit python 3 is supported. This issue was created before the python 3 support.

@warchildmd I think this issue should be marked as solved. As is causing some confusion.

@Moulde
Copy link

Moulde commented Sep 16, 2017

Ah yes suddenly it worked :) Thanks Shaxine

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

7 participants