如何在Mac上安装pocketsphinx

2024-09-27 17:57:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在Mac10.14.6上安装pocketsphinx,但收到一条非常长的错误消息。我正在尝试安装此软件包,以便能够使用pypi软件包SpeechRecognition,以便使用Mac的麦克风录制某种语言(如英语、法语、日语)的单词或句子,并将其转换为适当的文本字符串

我在Python3.8.6中使用的命令是

pip install pocketsphinx

错误信息的最后一小部分如下:

...
...
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/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/adietz/Private/Coding/Voice/venv/include -I/usr/local/opt/python@3.8/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/python@3.8/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/python@3.8/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/python@3.8/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/python@3.8/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/python@3.8/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/python@3.8/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/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/user/Voice/venv/include -I/usr/local/opt/python@3.8/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('"'"'\r\n'"'"', '"'"'\n'"'"');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.

我错过了什么


Tags: includeusrlocallibraryframeworkversionsadswig

热门问题