安裝PyAudio我已經試過如何在virtualenv中在Mac OS X 10.7
easy_install pyaudio
,它不工作。我得到以下:
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.7
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.7.tar.gz
Processing pyaudio-0.2.7.tar.gz
Writing /var/folders/vg/98k5hfl52m16wm45ckdx1_5c0000gp/T/easy_install-s1wLkT/PyAudio-0.2.7/setup.cfg
Running PyAudio-0.2.7/setup.py -q bdist_egg --dist-dir /var/folders/vg/98k5hfl52m16wm45ckdx1_5c0000gp/T/easy_install-s1wLkT/PyAudio-0.2.7/egg-dist-tmp-pFDrFR
warning: no files found matching '*.c' under directory 'test'
clang: warning: argument unused during compilation: '-mno-fused-madd'
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^
1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
請問用的virtualenv這項工作?我原以爲這將是Python路徑編輯:抱歉有一個愚蠢的時刻! – gazzwi86
或自制軟件:'brew install portaudio' –
如果您使用virtualenv(或使用virtualenvwrapper),pyaudio在安裝過程中將找不到portaudio。 [這個答案](http://stackoverflow.com/a/10290595/1386245)極大地幫助了我。 – Rohmer