I'm trying to install pocketsphinx on Windows 7 for Python 2.7. I found this https://github.com/bambocher/pocketsphinx-python, installed the dependencies, ran pip install pocketsphinx, which resulted in the "Successfully installed pocketsphinx-0.0.5" message, but when I attempt to run python file which contains import pocketsphinx I get an import error, "no module named pocketsphinx." Any idea what the problem could be?
Asked
Active
Viewed 2,133 times
0
-
Try this, which is from the docs: `from pocketsphinx.pocketsphinx import *` – simplycoding Jun 22 '15 at 21:39
-
I had that in my code earlier, gives the same problem. "No module named pocketsphinx.pocketsphinx." – Forest Hughes Jun 22 '15 at 21:41
2 Answers
2
Windows Solution
Christoph Gohlke kindly added a compiled version of pocketsphinx to his unofficial extension library.
If you are running Python 2.7 (32-bit) then download: "pocketsphinx-0.0.9-cp27-cp27m-win32.whl"
Here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx
Then run: pip install "pocketsphinx-0.0.9-cp27-cp27m-win32.whl"

Connor
- 670
- 3
- 9
- 29
1
The location you found is not well supported and has bugs. This particular one does not properly install __init__.py
, that's why you can not load the module. I suggest you to build the official one instead, it should work:

Nikolay Shmyrev
- 24,897
- 5
- 43
- 87