将PyAudio升级到最新版本时出错

jop*_*hab 2 python speech-recognition pyaudio

PyAudio (0.2.7)安装在我的系统中.

当我尝试升级使用时

sudo pip install pyaudio --upgrade
Run Code Online (Sandbox Code Playgroud)

我得到了这个.

Downloading/unpacking pyaudio from https://pypi.python.org/packages/44/39/f3b9b16d32cc8588fa06bb2e813cea35363f5502117cd6cc7f619b556d9f/PyAudio-0.2.10.tar.gz#md5=b65354d997fa00a9166f8dbcb83075e6
  Downloading PyAudio-0.2.10.tar.gz (287kB): 287kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pyaudio/setup.py) egg_info for package pyaudio

Installing collected packages: pyaudio
  Found existing installation: PyAudio 0.2.7
    Not uninstalling PyAudio at /usr/lib/python3/dist-packages, owned by OS


                                .......
                                .......

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.4/src/_portaudiomodule.o

src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory

 #include "portaudio.h"

                       ^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
  Can't roll back PyAudio; was not uninstalled
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ih3i9qsm-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pyaudio
Storing debug log for failure in /home/jobin/.pip/pip.log
Run Code Online (Sandbox Code Playgroud)

我正在使用初级操作系统14.04

这里有什么问题?

jop*_*hab 9

感谢@Cristian Ciupitu提供安装建议portaudio-dev.

但是portaudio-dev没有安装sudo apt-get install portaudio-dev在我的情况下.我有

E: Unable to locate package portaudio-dev 
Run Code Online (Sandbox Code Playgroud)

这是如何解决的

  1. 这里下载了.tgz的portaudio文件
  2. 然后解压缩下载的文件.
  3. cd到解压缩的文件夹.
  4. 然后./configure && make
  5. 现在做sudo make install
  6. 然后升级pyaudio sudo pip install pyaudio --upgrade

现在pyaudio已成功安装.