title: Python pocketsphinx RequestError: missing PocketSphinx module: ensure that PocketSphinx is set up correctly
body: <p>I am trying to make a Python app that can record audio and translate it into english text using PyAudio, SpeechRecognition and PocketSphinx. I'm running on a Mac OS X El Capitan, version 10.11.2.</p>
  
  <p>Following a tutorial like <a href="http://sauvikbiswas.com/2016/01/18/getting-speech-recognition-to-work-on-mac/" rel="noreferrer">this one</a> and others, I've downloaded PyAudio version 0.2.9, SpeechRecognition as well as PocketSphinx. I've installed them into a Conda environment. I have followed the instructions from this <a href="https://github.com/Uberi/speech_recognition/blob/master/reference/pocketsphinx.rst" rel="noreferrer">site</a> to use <code>brew install swig git python</code> on my OS X, hoping it would help.</p>
  
  <p>This is my code:</p>
  
  <pre><code># Load packages
  import speech_recognition as sr
  import sphinxbase
  import pocketsphinx
  
  # obtain audio from the microphone
  r = sr.Recognizer()
  with sr.Microphone() as source:
      print("Say something!")
      audio = r.listen(source)
  
  # write audio to a WAV file
  with open("microphone-results.wav", "wb") as f:
      f.write(audio.get_wav_data())
  </code></pre>
  
  <p>So far things are working great. I can record and play back my WAV file no problems. But here is where things go wrong...</p>
  
  <pre><code>r = sr.Recognizer()
  with sr.AudioFile('microphone-results.wav') as source:
      audio = r.record(source) # read the entire audio file
  
  try:
      print("You said " +  r.recognize_sphinx(audio))
  except LookupError:         # speech is unintelligible
      print("Could not understand audio")
  </code></pre>
  
  <p>When I run this code I get: 
  <code>RequestError: missing PocketSphinx module: ensure that PocketSphinx is set up correctly.</code></p>
  
  <p>I have installed PocketSphinx and Sphinxbase both globally and in virtual conda envs but to no avail. Documentation on this error on Google / SO posts is close to zero so I'm not sure what is going on. Any help/ advice would be greatly appreciated.</p>
  
  <p>Here is a list of my installed packages and their versions for my conda virtual environment:</p>
  
  <pre><code># packages in environment at /Users/nathancheever/anaconda/envs/audio_2:
  #
  appnope                   0.1.0                    py27_0
  backports-abc             0.4                       &lt;pip&gt;
  backports.ssl-match-hostname 3.4.0.2                   &lt;pip&gt;
  backports_abc             0.4                      py27_0
  decorator                 4.0.9                    py27_0
  freetype                  2.5.5                         0
  ipykernel                 4.3.1                    py27_0
  ipython                   4.1.2                    py27_2
  ipython-genutils          0.1.0                     &lt;pip&gt;
  ipython_genutils          0.1.0                    py27_0
  ipywidgets                4.1.1                    py27_0
  jinja2                    2.8                      py27_0
  jsonschema                2.4.0                    py27_0
  jupyter                   1.0.0                    py27_2
  jupyter-client            4.2.2                     &lt;pip&gt;
  jupyter-console           4.1.1                     &lt;pip&gt;
  jupyter-core              4.1.0                     &lt;pip&gt;
  jupyter_client            4.2.2                    py27_0
  jupyter_console           4.1.1                    py27_0
  jupyter_core              4.1.0                    py27_0
  libpng                    1.6.17                        0
  markupsafe                0.23                     py27_0
  mistune                   0.7.2                    py27_1
  nbconvert                 4.1.0                    py27_0
  nbformat                  4.0.1                    py27_0
  notebook                  4.1.0                    py27_2
  openssl                   1.0.2g                        0
  path.py                   8.1.2                    py27_1
  pexpect                   4.0.1                    py27_0
  pickleshare               0.5                      py27_0
  pip                       8.1.1                    py27_1
  ptyprocess                0.5                      py27_0
  pyaudio                   0.2.9                     &lt;pip&gt;
  pygments                  2.1.3                    py27_0
  pyqt                      4.11.4                   py27_1
  python                    2.7.11                        0
  pyzmq                     15.2.0                   py27_0
  qt                        4.8.7                         1
  qtconsole                 4.2.1                    py27_0
  readline                  6.2                           2
  setuptools                20.6.7                   py27_0
  simplegeneric             0.8.1                    py27_0
  singledispatch            3.4.0.3                  py27_0
  sip                       4.16.9                   py27_0
  six                       1.10.0                   py27_0
  speechrecognition         3.4.2                     &lt;pip&gt;
  sphinxbase                0.8                       &lt;pip&gt;
  sqlite                    3.9.2                         0
  ssl_match_hostname        3.4.0.2                  py27_0
  terminado                 0.5                      py27_1
  tk                        8.5.18                        0
  tornado                   4.3                      py27_0
  traitlets                 4.2.1                    py27_0
  wheel                     0.29.0                   py27_0
  zlib                      1.2.8                         0
  </code></pre>