Installing PocketSphinx on a MAC OS X
Asked Answered
C

3

10

I'm trying to learn pocketsphinx using python, and therefore wanted to install the same on my Mac OSX Lion. However, I'm really not experienced with installing packages and modules in Python, and the documentation on this one is slightly confusing for me. Here's what I've done till now. I downloaded the pocketsphinx 0.8 version from the following website: http://sourceforge.net/projects/cmusphinx/files/pocketsphinx/0.8/

I tried to search for the same using macports, so I could install it using macports, but the search command could not find pocketsphinx. I'm aware that my question may be terribly amateur and I apologize in advance for the same.

I looked for the answer here and the closest question was this one: Setting Up PocketSphinx in Mac OS X But the question seems unanswered. Therefore, could someone help me install this package on my system?

Coroneted answered 15/2, 2013 at 8:15 Comment(0)
C
17

There is a homebrew formula for pocketsphinx, which (just) installed fine on my system (Mountain Lion). Maybe try that? brew install cmu-pocketsphinx worked for me...

Clea answered 15/2, 2013 at 8:19 Comment(4)
Thanks a lot for the quick reply! I haven't used homebrew before, could you direct me to how I could go about executing the formula after I have homebrew set up? I'm really sorry for being terribly novice about this.Coroneted
Thanks a lot! I tried out the edit after installing homebrew. Gave a few warnings about Macports interference possibilities and Xcode not being up do date and therefore wouldn't install. I've removed macports but it still doesn't work, so am presently updating my Xcode version.Coroneted
Here's the error I'm getting. Did you face something similar? ` Compiling against the system-provided Python will likely fail. The system-provided Python includes PPC support, which will cause a compiler mis-match. This formula is known to work against a Homebrewed Python. Patches to correct this issue are welcome. Error: An unsatisfied requirement failed this build. ` I think this is probably because I'm using Apple's built-in python. Is that correct?Coroneted
So basically, my question is, whether you had installed pocketsphinx and are running it with the 'Apple built-in' python? Or did you have to install python with homebrew?Coroneted
C
11

I set up pocketsphinx successfully for python by:

brew install cmu-pocketsphinx
brew install swig
pip3 install --upgrade pip setuptools wheel
brew install openal-soft
cd /usr/local/include
ln -s /usr/local/Cellar/openal-soft/1.20.1/include/AL/* .    
pip3 install pocketsphinx

The last 4 commands come from this answer.

MacOS 10.14, Python 3.7.

Castera answered 25/6, 2020 at 0:53 Comment(6)
This might go without saying, but for anyone reading this in the future, make sure to check the version of openal-soft that is installed so that the path in the link statement is correct. Awesome answer!Divisible
Thank you very much @qianlei , your post saved me today.Millan
Thank you very much!Starinsky
derek.z: thank you so much! I've been looking for a solution for this for a long time.Suffruticose
For people looking to install on Big Sur, this person made a git repo for the fix described in this answer and the link: github.com/bambocher/pocketsphinx-python/issues/…Bowel
Creating soft links in /usr/local/include did not work for me on Catalina, but the first solution in that GitHub issue worked.Taste
G
6

I used this homebrew - https://github.com/watsonbox/homebrew-cmu-sphinx

Which fixed this error for me

A/D library not implemented FATAL_ERROR: "continuous.c", line 246: Failed to open audio device

To test the installation, use

pocketsphinx_continuous -inmic yes

Gowrie answered 31/12, 2014 at 3:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.