lihp123
Posts: 2
Joined: Mon Jan 30, 2017 9:02 pm

Error installing python module pocketsphinx

Mon Jan 30, 2017 9:13 pm

Hello everyone,
i'm stuck on a problem, tying to install the pocketsphinx-python.
Using a Raspberry Pi 3 B, installed the newest raspbian.

When i try to do 'sudo pip install pocketsphinx' or 'sudo pip install --upgrade pocketsphinx' i am getting this error:

Collecting pocketsphinx
Using cached pocketsphinx-0.1.3.zip
Building wheels for collected packages: pocketsphinx
Running setup.py bdist_wheel for pocketsphinx ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-BoHqvt/pocketsphinx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp5c6IPZpip-wheel- --python-tag cp27:
running bdist_wheel
running build_ext
building 'sphinxbase._ad' extension
swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
swig -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
creating build
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/swig
creating build/temp.linux-armv7l-2.7/swig/sphinxbase
creating build/temp.linux-armv7l-2.7/deps
creating build/temp.linux-armv7l-2.7/deps/sphinxbase
creating build/temp.linux-armv7l-2.7/deps/sphinxbase/src
creating build/temp.linux-armv7l-2.7/deps/sphinxbase/src/libsphinxad
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python2.7 -c swig/sphinxbase/ad_wrap.c -o build/temp.linux-armv7l-2.7/swig/sphinxbase/ad_wrap.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation
In file included from deps/sphinxbase/include/sphinxbase/ad.h:44:0,
from swig/sphinxbase/ad_wrap.c:2958:
deps/sphinxbase/include/android/sphinx_config.h:11:0: warning: "SIZEOF_LONG" redefined
#define SIZEOF_LONG 8
^
In file included from /usr/include/python2.7/pyconfig.h:13:0,
from /usr/include/python2.7/Python.h:8,
from swig/sphinxbase/ad_wrap.c:130:
/usr/include/arm-linux-gnueabihf/python2.7/pyconfig.h:1013:0: note: this is the location of the previous definition
#define SIZEOF_LONG 4
^
cc1: warning: unrecognized command line option "-Wno-misleading-indentation"
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python2.7 -c deps/sphinxbase/src/libsphinxad/ad_pulse.c -o build/temp.linux-armv7l-2.7/deps/sphinxbase/src/libsphinxad/ad_pulse.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation
deps/sphinxbase/src/libsphinxad/ad_pulse.c:44:30: fatal error: pulse/pulseaudio.h: No such file or directory
#include <pulse/pulseaudio.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for pocketsphinx
Running setup.py clean for pocketsphinx
Failed to build pocketsphinx
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-BoHqvt/pocketsphinx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-DRRwzQ-record/install-record.txt --single-version-externally-managed --compile:
running install
running build_ext
building 'sphinxbase._ad' extension
swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
swig -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
creating build
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/swig
creating build/temp.linux-armv7l-2.7/swig/sphinxbase
creating build/temp.linux-armv7l-2.7/deps
creating build/temp.linux-armv7l-2.7/deps/sphinxbase
creating build/temp.linux-armv7l-2.7/deps/sphinxbase/src
creating build/temp.linux-armv7l-2.7/deps/sphinxbase/src/libsphinxad
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python2.7 -c swig/sphinxbase/ad_wrap.c -o build/temp.linux-armv7l-2.7/swig/sphinxbase/ad_wrap.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation
In file included from deps/sphinxbase/include/sphinxbase/ad.h:44:0,
from swig/sphinxbase/ad_wrap.c:2958:
deps/sphinxbase/include/android/sphinx_config.h:11:0: warning: "SIZEOF_LONG" redefined
#define SIZEOF_LONG 8
^
In file included from /usr/include/python2.7/pyconfig.h:13:0,
from /usr/include/python2.7/Python.h:8,
from swig/sphinxbase/ad_wrap.c:130:
/usr/include/arm-linux-gnueabihf/python2.7/pyconfig.h:1013:0: note: this is the location of the previous definition
#define SIZEOF_LONG 4
^
cc1: warning: unrecognized command line option "-Wno-misleading-indentation"
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python2.7 -c deps/sphinxbase/src/libsphinxad/ad_pulse.c -o build/temp.linux-armv7l-2.7/deps/sphinxbase/src/libsphinxad/ad_pulse.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation
deps/sphinxbase/src/libsphinxad/ad_pulse.c:44:30: fatal error: pulse/pulseaudio.h: No such file or directory
#include <pulse/pulseaudio.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-BoHqvt/pocketsphinx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-DRRwzQ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-BoHqvt/pocketsphinx/




Anyone has an idea what the problem is?
Already spent like 10 hours again and again reformatting my sd-card...

dgordon42
Posts: 764
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: Error installing python module pocketsphinx

Tue Jan 31, 2017 11:50 am

Both 'pocketsphinx' and 'python-pocketsphinx' are in the Raspbian Jessie repositories.
Why not try:

Code: Select all

sudo apt-get update
sudo apt-get install pocketsphinx
sudo apt-get install python-pocketsphinx
and follow the prompts.

I don't know who well it will run on a Pi.

Hope this helps,
Dave.

lihp123
Posts: 2
Joined: Mon Jan 30, 2017 9:02 pm

Re: Error installing python module pocketsphinx

Tue Jan 31, 2017 11:57 pm

thanks for the idea, but it actually doesnt work that good.
the python module im trying to install with pip (pocketsphinx) has the function LiveSpeech(), which i kinda would like to use.
But it is not found in the python-pocketsphinx.

So maybe any idea what the error i am getting is about?
especially this one:
deps/sphinxbase/include/android/sphinx_config.h:11:0: warning: "SIZEOF_LONG" redefined
#define SIZEOF_LONG 8


thanks for any help

ginsi
Posts: 1
Joined: Wed Dec 13, 2017 4:46 pm

Re: Error installing python module pocketsphinx

Wed Dec 13, 2017 4:55 pm

As this is my first post, -"Hi everybody!"
I hope I will be forgiven for resurrecting this almost_1_year_old thread, but I think I have the solution...
I had the same problem and I could solve it by doing

Code: Select all

sudo apt-get install libpulse-dev --yes
Hope this will help!

fmonjaraz
Posts: 1
Joined: Thu Jun 21, 2018 6:38 pm

Re: Error installing python module pocketsphinx

Thu Jun 21, 2018 6:42 pm

Yes, this fixed the problem for me. I had to do this first:
sudo apt-get update
Then,
sudo apt-get install libpulse-dev —yes
Finally, I re-installed pocketsphinx
sudo apt-get install pocketsphinx
or
pip install —upgrade pocketspinx

OZ3R0
Posts: 6
Joined: Mon Aug 12, 2019 2:20 am
Location: Mexico City

Re: Error installing python module pocketsphinx

Sun Nov 10, 2019 10:11 pm

fmonjaraz wrote:
Thu Jun 21, 2018 6:42 pm
Yes, this fixed the problem for me. I had to do this first:
sudo apt-get update
Then,
sudo apt-get install libpulse-dev —yes
Finally, I re-installed pocketsphinx
sudo apt-get install pocketsphinx
or
pip install —upgrade pocketspinx
Could you use the LiveSpeech function correctly?

I have a problem, I was able to install pocketsphinx successfully. But when I try to get the path to use the Live Speech function I have the following message:
<function get_model_path at 0xb678d570>

Return to “Troubleshooting”