0

I've already installed this package (SpeechRecognition) on my laptop, now I'm trying to make it work on my Imac (sierra aswell). I followed the installation the same as on the macbook.

But when trying to run the test I get following error.

python -m speech_recognition

Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 111, in _get_module_details
    __import__(mod_name)  # Do not catch exceptions initializing package
  File "/usr/local/lib/python2.7/site-packages/speech_recognition/__init__.py", line 5, in <module>
    import io
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
Blckpstv
  • 117
  • 3
  • 17
  • Looks like there's an issue with your Python installation... – ForceBru Jan 15 '17 at 20:20
  • Maybe PATH problems? When '''echo $PYTHONPATH''' I get an empty line as result – Blckpstv Jan 15 '17 at 20:31
  • You installed the package with the system python, then tried to use it with a user-installed python. Make sure you install and use the package with the same python. – Stop harming Monica Jan 15 '17 at 20:37
  • 1
    Possible duplicate of [Symbol not found: \_\_PyCodecInfo\_GetIncrementalDecoder](http://stackoverflow.com/questions/34386527/symbol-not-found-pycodecinfo-getincrementaldecoder) – Nikolay Shmyrev Jan 15 '17 at 21:42

1 Answers1

0

Try going to terminal and typing in that:

python -m speech_recognition

or

python3 -m speech_recognition

If that's what your running.

it depends what version of python your using, Sierra comes with python IDLE 2.7.10 already installed.

if you download those modules for python it will download them to work with 2.7.10 not the 3.0 + you might be using.

so if you downloaded python3 and are trying to run it with python3 it won't work, only from 2.7.10 so try typing in.

python -m speech_recognition

Like i suggested and see if it works in the terminal, if it does then it means i was right and python 2.7.10 will work with it.

Sergei Glimis
  • 390
  • 2
  • 5
  • 17