I am trying to build speech recognition application in ubuntu . And went through the tutorial and downloaded both sphinxbase and pocketsphinx from https://sourceforge.net/projects/cmusphinx/files/ and installed them using the correct guidelines from their readme files for installation. Now am building the decoding script which is as below -

from os import environ, path

from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *

hmdir="/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k"
lmd="/usr/local/share/pocketsphinx/model/en_US/wsj0vp.5000.DMP"
dictd="/usr/local/share/pocketsphinx/model/en_US/cmu07a.dic"

def decodeSpeech(hmmd,lmdir,dictp,wavfile):

speechRec=pocketsphinx.Decoder(hmm=hmmd,lm=lmdir, dict=dictp)
wavFile=file(wavfile,'rb')
wavFile.seek(44)
speechRec.decode_raw(wavFile)
result=speechRec.get_hyp()
return result[0]

wavfile="rec.wav"
recognised=decodeSpeech(hmdir,lmd,dictd,wavfile)
print recognised

but the terminal is showing following errors-
File "sphin.py", line 4, in <module>
from pocketsphinx.pocketsphinx import *
ImportError: No module named pocketsphinx.pocketsphinx