问题
I am running Enthought Python 2.7
as well as default Python 2.7
, Xcode 4.5.1
in Mac OS 10.8.2
. I am trying to develop a speech to text converter in Python
. I use Enthought Python
as it allows me to record in 16000Hz, 1 Channel
using pyaudio
, which is needed for pocketsphinx
to work.
I am trying to setup pocketsphinx
using brew install pocketsphinx
.
I get the following errors
Even manual installation using make
and using default python
results in same errors
Using brew doctor, I get
How do I successfully install pocketsphinx
?
Here is my config.log
Homebrew logs pocketsphinx, sphinxbase
回答1:
According to the log you have outdated version of the libsndfile installed. You have a header sndfile.h, but not sndfile.pc pkg-config file:
configure:14532: checking for SNDFILE
configure:14540: $PKG_CONFIG --exists --print-errors "sndfile"
Package sndfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `sndfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sndfile' found
configure:14543: $? = 1
configure:14558: $PKG_CONFIG --exists --print-errors "sndfile"
Package sndfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `sndfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sndfile' found
configure:14561: $? = 1
No package 'sndfile' found
configure:14589: result: no
configure:14603: checking sndfile.h usability
configure:14603: gcc -std=gnu99 -c -g -O2 -Wall -
I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -
I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 conftest.c >&5
configure:14603: $? = 0
configure:14603: result: yes
To solve this problem either remove the header to not confuse the configure or install newer sndfile with pkg-config support.
Actually that should be fixed in sphinxbase as well, a bug report would be welcome.
来源:https://stackoverflow.com/questions/13283116/setting-up-pocketsphinx-in-mac-os-x