1

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 enter image description here

Even manual installation using make and using default python results in same errors enter image description here

Using brew doctor, I getenter image description here

How do I successfully install pocketsphinx?

Here is my config.log

Homebrew logs pocketsphinx, sphinxbase

Bash_Profile

VeilEclipse
  • 2,766
  • 9
  • 35
  • 53
  • The build process fails to find sndfile library. It might becaused by the issues in configure stage. In order to understand such issues you need to check the file config.log created by configure. You need to share that file to enable others to hlep with this problem. – Nikolay Shmyrev Nov 09 '12 at 08:03
  • @NikolayShmyrev: THanks for your reply. I uploaded my config.log – VeilEclipse Nov 09 '12 at 14:04

1 Answers1

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.

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • 1
    Thanks a lot for your help. I was finally able to install `pocketsphinx` using `brew install pocketsphinx` – VeilEclipse Nov 10 '12 at 13:06
  • Here i get a new error, http://dl.dropbox.com/u/69889915/Screen%20Shot%202012-11-10%20at%206.37.41%20PM.png – VeilEclipse Nov 10 '12 at 13:21
  • Try to import sphixnbase first and make sure sphinxbase is also installed properly. – Nikolay Shmyrev Nov 10 '12 at 16:39
  • 1
    I installed `sphinxbase` and `pocketsphinx` properly. BUt the error in the previous link was due to previous manual installation of `pocketsphinx` which failed while building `sphinxbase`. But now after successful `brew install pocketsphinx`, there was no where `pocketsphinx` libraries in the `site-packages` in any of the python versions I have. Now it shows `ImportError: No module named pocketsphinx` – VeilEclipse Nov 11 '12 at 05:40
  • It doesn't seem like the installation is correct. You need to provide more information. Please provide build logs for sphinxbase and pocketsphinx, maybe it didn't build python at all. – Nikolay Shmyrev Nov 11 '12 at 06:24
  • According to the log the file is installed here copying build/lib.macosx-10.8-intel-2.7/sphinxbase.so -> /usr/local/Cellar/cmu-sphinxbase/0.7/lib/python2.7/site-packages – Nikolay Shmyrev Nov 11 '12 at 17:27
  • I added this to my `.bash_profile` `export LD_LIBRARY_PATH=/usr/local/lib`, `export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig`. But still I dont see any change – VeilEclipse Nov 12 '12 at 04:33
  • What sort of change to you expect? I'm not sure what your current problem is. Python module lookup is controlled by the PYTHON_PATH environment variable. – Nikolay Shmyrev Nov 12 '12 at 09:58
  • I explained you already that it's not related to the path or to .bash_profile. Instead you need to copy the module (sphinxbase.so and pocketsphinx.so) to the proper location where pocketsphinx will find it. – Nikolay Shmyrev Nov 12 '12 at 21:18
  • 1
    What do i do for `A/D library not implemented FATAL_ERROR: "continuous.c", line 246: Failed to open audio device logout`? – VeilEclipse Dec 14 '12 at 07:33