问题
This will probably get tagged as a duplicate, but I haven't had any luck, so here we go.
I'm trying to develop a "Jarvis" like setup with Python2.7. I', looking to use Pocketsphinx as part of that. I tried to do this on my Windows 10 machine, but Pocketsphinx requires Swig, and that utterly failed on the Windows 10 machine (I'm still working on that.) So, I moved over to my Raspberry Pi Zero, since that is where I will be looking to impliment the actual program anyways.
I got Swig to install just fine. None of the problems that Windows 10 had. Then I tried to install Pocketsphinx and things went down the toilet. Install failed after just a little bit. I read that I needed to download python developer for 2.7. Got that accomplished and things seemed to be going well. I got a bunch of stuff rolling accross the screen and it looked like it might just work. Nope. That's when I got this:
deps/sphinxbase/src/libsphinxad/ad_pulse.c:44:30: fatal error: pulse/pulseaudio.h: No such file or directory
include
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Cleaning up... Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-Wt0cIJ/pocketsphinx/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-UOA_Nf-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-Wt0cIJ/pocketsphinx Traceback (most recent call last): File "/usr/bin/pip", line 9, in load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() File "/usr/lib/python2.7/dist-packages/pip/init.py", line 248, in main return command.main(cmd_args) File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 51: ordinal not in range(128)
I'm getting kinda sick of looking at errors for today. Anybody got a clue for me? I'll admit that I am still just getting started in the programming world, but this is making my brain start to sizzle.
回答1:
As mentioned by Peter Brittain, install libpulse-dev
on the machine. I can confirm this worked for me:
sudo apt-get install libpulse-dev
回答2:
If this still doesn't work, you should also try installing the following:
sudo apt-get install portaudio19-dev swig
I know for a fact that this error can also be caused by not having portaudio19-dev installed. Swig is also a requirement, but might throw another error. You might also need to install pulseaudio
to prevent a RuntimeError.
来源:https://stackoverflow.com/questions/39185141/pocketsphinx-install-fail-raspberry-pi-zero-raspbian-jessie