Python module ImportError: No module named pocketsphinx

Came across the error while experimenting with pocketsphinx – CMU Speech Recognition Kit.

Modules already installed by package manager:

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 "", 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 

Save and exit.
source ~/.bashrc

Thats It. We are done here. Cheers.

Note: Add the PYTHONPATH accordingly as where your python is present.

2 thoughts on “Python module ImportError: No module named pocketsphinx”

  1. Pingback: Python – No module named fooCopyQuery CopyQuery | Question & Answer Tool for your Technical Queries,CopyQuery, ejjuit, query, copyquery,, android doubt, ios question, sql query, sqlite query, nodejsquery, dns query, update query, i

Leave a Reply

Your email address will not be published. Required fields are marked *