1

I have a script like this in python3 (This is just part of it):

    import speech_recognition as sr

    r = sr.Recognizer()
    with sr.Microphone() as source:
            r.adjust_for_ambient_noise(source)
            audio =r.listen(source)
    command = r.recognize_sphinx(audio)

It basically interprets what I say and executes simple commands, but when I run it, it gives me this a huge error:

Traceback (most recent call last):
  File     "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-    packages/sphinxbase/sphinxbase.py", line 32, in swig_import_helper
    return importlib.import_module(mname)
  File     "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importli    b/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in     _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 903, in     create_module
  File "<frozen importlib._bootstrap>", line 222, in     _call_with_frames_removed
ImportError:     dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/si    te-packages/sphinxbase/_sphinxbase.so, 2): Symbol not found:     _PyClass_Type
  Referenced from:     /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-    packages/sphinxbase/_sphinxbase.so
  Expected in: flat namespace
 in     /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-    packages/sphinxbase/_sphinxbase.so

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File     "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-    packages/speech_recognition/__init__.py", line 580, in recognize_sphinx
    from sphinxbase import sphinxbase
  File     "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-    packages/sphinxbase/sphinxbase.py", line 35, in <module>
    _sphinxbase = swig_import_helper()
  File     "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-    packages/sphinxbase/sphinxbase.py", line 34, in swig_import_helper
    return importlib.import_module('_sphinxbase')
  File     "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importli    b/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_sphinxbase'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/luistripa/Desktop/Infinity/Confidential/AI.py", line     94, in <module>
    Main()
  File "/Users/luistripa/Desktop/Infinity/Confidential/AI.py", line     37, in Main
    command = r.recognize_sphinx(audio)
  File     "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-    packages/speech_recognition/__init__.py", line 582, in recognize_sphinx
    raise RequestError("missing PocketSphinx module: ensure that     PocketSphinx is set up correctly.")
speech_recognition.RequestError: missing PocketSphinx module: ensure     that PocketSphinx is set up correctly.

I am sure I have pocket sphinx setup correctly and all it's dependencies. Can anyone help me?

luistripa
  • 37
  • 9
  • Possible duplicate of [Python pocketsphinx RequestError: missing PocketSphinx module: ensure that PocketSphinx is set up correctly](https://stackoverflow.com/questions/36523705/python-pocketsphinx-requesterror-missing-pocketsphinx-module-ensure-that-pocke) – Nikolay Shmyrev Jul 16 '17 at 09:08

0 Answers0