尝试使用说明per here安装pyaudio:
$git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
$cd pyaudio
$sudo python setup.py install
running install
running build
running build_py
running build_ext
building '_portaudio' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:28:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:215:0: note: this is the location of the previous definition
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
我的装置出了什么问题?
解决方法:
抱歉上次不恰当的回答,我会发布问题的解决方案.它可能对Ubuntu发行版很有帮助.
>首先我们需要安装portaudio模块:sudo apt-get install libasound-dev
>从以下位置下载portaudio存档:http://portaudio.com/download.html
>解压缩档案:tar -zxvf [portaudio.tgz]
>输入目录,然后运行:./ configure&&使
>安装:sudo make install
>最后:sudo pip安装pyaudio
>检查pyaudio的版本,它应该是0.2.9