Came across the error while experimenting with pocketsphinx – CMU Speech Recognition Kit.
Modules already installed by package manager:
python-pocketsphinx
pocketsphinx-hmm-wsj1
pocketsphinx-lm-wsj
Python shell is able to locate libs
help(‘pocketsphinx’) & dir(‘pocketsphinx’) works fine on the python shell, but importing it in the external script blows up with the below error:
Traceback (most recent call last): File "pythonPocketSphinxTest2.py", line 6, in < module > import pocketsphinx ImportError: No module named pocketsphinx
Quick fix:
The system is not able to find the python libs, just provide PYTHONPATH to system path.
vi ~/.bashrc
Add below lines:
export PYTHONPATH=/usr/lib/pymodules/python2.7 export PATH=$PATH:$PYTHONPATH
Save and exit.
source ~/.bashrc
Thats It. We are done here. Cheers.
Note: Add the PYTHONPATH accordingly as where your python is present.
Pingback: Python – No module named fooCopyQuery CopyQuery | Question & Answer Tool for your Technical Queries,CopyQuery, ejjuit, query, copyquery, copyquery.com, android doubt, ios question, sql query, sqlite query, nodejsquery, dns query, update query, i
Still not working , showing the same error to me.Pls suggest me other option.