Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

python - How to install pocketsphinx on a Mac

I am trying to install pocketsphinx on a Mac 10.14.6, but I get a tremendous long error message. I am trying to install this package to be able to use the pypi package SpeechRecognition in order to use the Mac's microphone to record a word or a sentence in some language (e.g. English, French, Japanese) which is transformed into the appropriate text string.

The command I am using with python 3.8.6 is

pip install pocketsphinx

and a very small last part of the error message is here:

...
...
building 'sphinxbase._ad_openal' extension
    swigging swig/sphinxbase/ad_openal.i to swig/sphinxbase/ad_openal_wrap.c
    swig -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_openal_wrap.c swig/sphinxbase/ad_openal.i
    Deprecated command line option: -modern. This option is now always on.
    creating build/temp.macosx-10.14-x86_64-3.8/swig
    creating build/temp.macosx-10.14-x86_64-3.8/swig/sphinxbase
    creating build/temp.macosx-10.14-x86_64-3.8/deps/sphinxbase/src/libsphinxad
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/adietz/Private/Coding/Voice/venv/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c swig/sphinxbase/ad_openal_wrap.c -o build/temp.macosx-10.14-x86_64-3.8/swig/sphinxbase/ad_openal_wrap.o -Wno-macro-redefined -Wno-sign-compare -Wno-logical-op-parentheses
    swig/sphinxbase/ad_openal_wrap.c:1757:7: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
          0,                                    /* tp_print */
          ^
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
        Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
        ^
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    swig/sphinxbase/ad_openal_wrap.c:1924:7: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
          0,                                    /* tp_print */
          ^
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
        Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
        ^
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    swig/sphinxbase/ad_openal_wrap.c:3878:9: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
            0,                                  /* tp_print */
            ^
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
        Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
        ^
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    3 warnings generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/user/Voice/venv/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c deps/sphinxbase/src/libsphinxad/ad_openal.c -o build/temp.macosx-10.14-x86_64-3.8/deps/sphinxbase/src/libsphinxad/ad_openal.o -Wno-macro-redefined -Wno-sign-compare -Wno-logical-op-parentheses
    deps/sphinxbase/src/libsphinxad/ad_openal.c:43:10: fatal error: 'al.h' file not found
    #include <al.h>
             ^~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/user/Voice/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-install-6gpn9rjp/pocketsphinx_7af5e010936245adbb59489ab3846a45/setup.py'"'"'; __file__='"'"'/private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-install-6gpn9rjp/pocketsphinx_7af5e010936245adbb59489ab3846a45/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/0g/wwq2q6nn35n8vmrwhw5qfk601zlkw_/T/pip-record-j3hanech/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/Voice/venv/include/site/python3.8/pocketsphinx Check the logs for full command output.

What am I missing?

question from:https://stackoverflow.com/questions/65858454/how-to-install-pocketsphinx-on-a-mac

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...