User avatar
Zilla707
Posts: 70
Joined: Fri Aug 23, 2019 11:04 pm

PocketSphinx won't Install

Wed Sep 11, 2019 9:09 pm

Hello, I am trying to get speech-to-text using pocketsphinx, but when I run "pip3 install pocketsphinx" or "pip install pocketsphinx" all that it gives me are errors. I have pasted some below, but there are too many to do all of them.

Code: Select all

[email protected]:~ $ pip3 install pocketsphinx
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pocketsphinx
  Using cached https://files.pythonhosted.org/packages/cd/4a/adea55f189a81aed88efa0b0e1d25628e5ed22622ab9174bf696dd4f9474/pocketsphinx-0.1.15.tar.gz
Building wheels for collected packages: pocketsphinx
  Running setup.py bdist_wheel for pocketsphinx ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ejfe8jp1/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/pip-wheel-gyp60481 --python-tag cp37:
  running bdist_wheel
  running build_ext
  building 'sphinxbase._sphinxbase' extension
  swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
  swig -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
  creating build
  creating build/temp.linux-armv7l-3.7
  creating build/temp.linux-armv7l-3.7/deps
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase/src
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/feat
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase/swig
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.7m -c deps/sphinxbase/src/libsphinxbase/lm/ngram_model.c -o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/ngram_model.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
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.7m -c deps/sphinxbase/src/libsphinxbase/lm/ngram_model_set.c -o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/ngram_model_set.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
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.7m -c deps/sphinxbase/src/libsphinxbase/lm/jsgf.c -o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/jsgf.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
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.7m -c deps/sphinxbase/src/libsphinxbase/lm/jsgf_scanner.c -o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/jsgf_scanner.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
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -
  
  In file included from /usr/include/python3.7m/pyconfig.h:13,
                   from /usr/include/python3.7m/Python.h:8,
                   from deps/pocketsphinx/swig/pocketsphinx_wrap.c:11:
  /usr/include/arm-linux-gnueabihf/python3.7m/pyconfig.h:1363: note: this is the location of the previous definition
   #define SIZEOF_LONG 4
  
  deps/pocketsphinx/swig/pocketsphinx_wrap.c: In function ‘_wrap_Decoder_process_raw’:
  deps/pocketsphinx/swig/pocketsphinx_wrap.c:5715:5: warning: ‘PyObject_AsReadBuffer’ is deprecated [-Wdeprecated-declarations]
       res2 = PyObject_AsReadBuffer(obj1, &buf2, &size2);
       ^~~~
  In file included from /usr/include/python3.7m/Python.h:147,
                   from deps/pocketsphinx/swig/pocketsphinx_wrap.c:11:
  /usr/include/python3.7m/abstract.h:489:17: note: declared here
   PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj,
                   ^~~~~~~~~~~~~~~~~~~~~
  deps/pocketsphinx/swig/pocketsphinx_wrap.c: In function ‘_wrap_Decoder_process_cep’:
  deps/pocketsphinx/swig/pocketsphinx_wrap.c:5784:5: warning: ‘PyObject_AsReadBuffer’ is deprecated [-Wdeprecated-declarations]
       res2 = PyObject_AsReadBuffer(obj1, &buf2, &size2);
       ^~~~
  In file included from /usr/include/python3.7m/Python.h:147,
                   from deps/pocketsphinx/swig/pocketsphinx_wrap.c:11:
  /usr/include/python3.7m/abstract.h:489:17: note: declared here
   PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj,
                   ^~~~~~~~~~~~~~~~~~~~~
  creating build/lib.linux-armv7l-3.7/pocketsphinx
  arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/ngram_model.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/ngram_model_set.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/jsgf.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/jsgf_scanner.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/jsgf_parser.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/lm_trie.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/fsg_model.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/lm_trie_quant.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/ngram_model_trie.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/lm/ngrams_raw.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/feat/cmn_live.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/feat/feat.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/feat/agc.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/feat/cmn.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/feat/lda.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/cmd_ln.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/filename.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/bitvec.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/bio.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/case.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/slapack_lite.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/logmath.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/profile.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/slamch.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/dtoa.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/mmio.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/glist.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/heap.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/matrix.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/hash_table.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/errno.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/pio.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/sbthread.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/listelem_alloc.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/priority_queue.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/blas_lite.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/strfuncs.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/bitarr.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/ckd_alloc.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/f2c_lite.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/err.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/util/genrand.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fe_warp.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fe_sigproc.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fe_prespch_buf.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fe_interface.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fe_warp_affine.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fe_noise.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fe_warp_piecewise_linear.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/yin.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fe_warp_inverse_linear.o build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxbase/fe/fixlog.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/mdef.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ps_lattice.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ps_alignment.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/state_align_search.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ngram_search.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/tmat.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/vector.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/fsg_search.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/blkarray_list.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/acmod.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/fsg_lextree.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ms_gauden.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ptm_mgau.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/pocketsphinx.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ms_mgau.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/dict2pid.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/s2_semi_mgau.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/bin_mdef.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/hmm.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/fsg_history.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/phone_loop_search.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/allphone_search.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/kws_search.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/dict.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ps_mllr.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ngram_search_fwdtree.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ms_senone.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/kws_detections.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/src/libpocketsphinx/ngram_search_fwdflat.o build/temp.linux-armv7l-3.7/deps/pocketsphinx/swig/pocketsphinx_wrap.o -o build/lib.linux-armv7l-3.7/pocketsphinx/_pocketsphinx.cpython-37m-arm-linux-gnueabihf.so
  building 'sphinxbase._ad_pulse' extension
  swigging swig/sphinxbase/ad_pulse.i to swig/sphinxbase/ad_pulse_wrap.c
  swig -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_pulse_wrap.c swig/sphinxbase/ad_pulse.i
  creating build/temp.linux-armv7l-3.7/swig
  creating build/temp.linux-armv7l-3.7/swig/sphinxbase
  creating build/temp.linux-armv7l-3.7/deps/sphinxbase/src/libsphinxad
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.7m -c swig/sphinxbase/ad_pulse_wrap.c -o build/temp.linux-armv7l-3.7/swig/sphinxbase/ad_pulse_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,
                   from swig/sphinxbase/ad_pulse_wrap.c:3046:
  deps/sphinxbase/include/android/sphinx_config.h:11: warning: "SIZEOF_LONG" redefined
   #define SIZEOF_LONG 8
  
  In file included from /usr/include/python3.7m/pyconfig.h:13,
                   from /usr/include/python3.7m/Python.h:8,
                   from swig/sphinxbase/ad_pulse_wrap.c:150:
  /usr/include/arm-linux-gnueabihf/python3.7m/pyconfig.h:1363: note: this is the location of the previous definition
   #define SIZEOF_LONG 4
  
  swig/sphinxbase/ad_pulse_wrap.c: In function ‘_wrap_Ad_readinto’:
  swig/sphinxbase/ad_pulse_wrap.c:3735:5: warning: ‘PyObject_AsWriteBuffer’ is deprecated [-Wdeprecated-declarations]
       res2 = PyObject_AsWriteBuffer(obj1, &buf2, &size2);
       ^~~~
  In file included from /usr/include/python3.7m/Python.h:147,
                   from swig/sphinxbase/ad_pulse_wrap.c:150:
  /usr/include/python3.7m/abstract.h:500:17: note: declared here
   PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj,
                   ^~~~~~~~~~~~~~~~~~~~~~
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python3.7m -c deps/sphinxbase/src/libsphinxad/ad_pulse.c -o build/temp.linux-armv7l-3.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:10: 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 ... \
# I had to cut a bunch out, there was too much to fit in this post.
Any help on this?
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

User avatar
B.Goode
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: PocketSphinx won't Install

Thu Sep 12, 2019 7:55 am

There seem to be lots of Warnings but (inevitably) only one terminally fatal Error.

I would say at an intelligent guess that you don't have the prerequisite pulseaudio development libraries installed.

User avatar
Zilla707
Posts: 70
Joined: Fri Aug 23, 2019 11:04 pm

Re: PocketSphinx won't Install

Thu Sep 12, 2019 11:50 pm

What libraries would I need to install for pulseAudio?
And, (is anyone else having this problem?)
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

User avatar
Zilla707
Posts: 70
Joined: Fri Aug 23, 2019 11:04 pm

Re: PocketSphinx won't Install

Fri Sep 13, 2019 1:38 am

I have solved it! I needed "sudo apt-get install pulseaudio libpulse-dev"!! Thanks so much for the suggestion.
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

Return to “Python”