title: Pocketsphinx import ValueError
body: <p>I recently installed pocketsphinx modules on my mac running Lion and Python 2.7.3(Not Apple's built in python, but brewed). I tried to run the following code:</p>
  
  <pre><code>import pocketsphinx as p
  decoder = p.Decoder(jsgf='/path_to_jsgf_file/grammar.jsgf',samprate='8000')
  fh = open('myrecording.wav', 'rb')
  nsamp = decoder.decode_raw(fh)
  print 'You said,', hyp
  print 'Your score was', score
  </code></pre>
  
  <p>But here's the error I get on running <code>import pocketsphinx as p :</code></p>
  
  <pre><code>Traceback (most recent call last):
  File "speech_reco.py", line 4, in &lt;module&gt;
  import pocketsphinx as p
  File "sphinxbase.pxd", line 150, in init pocketsphinx (pocketsphinx.c:7935)
  ValueError: PyCapsule_GetPointer called with invalid PyCapsule object
  </code></pre>
  
  <p>However, it runs correctly when the import command is run the second time. Therefore, presently, I'm running a try-catch there and getting past the error. But I don't know whether this still works.</p>
  
  <p>This issue seems to have come up before,as discussed on this link: <a href="http://sourceforge.net/p/cmusphinx/bugs/284/" rel="nofollow">http://sourceforge.net/p/cmusphinx/bugs/284/</a></p>
  
  <p>Has anyone fixed this issue yet? If not, would try- catch be the right way to get around this error?</p>