cmusphinx / pocketsphinx

A small speech recognizer
Other
3.87k stars 713 forks source link

Unable to import pocketsphinx when using Termux #377

Open compilebunny opened 7 months ago

compilebunny commented 7 months ago

This is on Termux v118 python 3.11.6 pocketsphinx 5.0.3

import pocketsphinx

produces


Traceback (most recent call last):
  File "/data/data/com.termux/files/home/sphinxtest.py", line 8, in <module>
    import pocketsphinx
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pocketsphinx/__init__.py", line 41, in <module>
    from . import _pocketsphinx as pocketsphinx  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen failed: cannot locate symbol "PyExc_ImportError" referenced by "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pocketsphinx/_pocketsphinx.cpython-311.so"...

instead of making the pocketsphinx library available for use.

dhdaines commented 3 months ago

Well, I was today days old when I learned what Termux is.

And it seems this is a known problem with a bunch of Python libraries: https://github.com/termux/termux-packages/issues/12430

You can see the full list of stuff that doesn't work in Termux here: https://github.com/android/ndk/issues/201