【发布时间】:2013-11-30 03:32:56
【问题描述】:
尝试使用指令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
我的安装出了什么问题?
【问题讨论】:
-
gcc 找不到 PortAudio 头文件,您是否安装了 PortAudio 开发包(例如
apt-get install libportaudio-dev用于 ubuntu)?附带说明一下,至少在 ubuntu 中,pyaudio 已经在 python 2 和 3 的存储库中,并且可以通过apt-get install python(3)-pyaudio安装。 -
那行得通,我会接受它作为答案谢谢!
-
对我有用的是 Cerin 在 AI_ROBOT 的回答中的评论。使用 Ubuntu 20.04.3 LTS