如何在Mac OS X 10.7上的virtualenv中安装PyAudio

2024-05-11 05:08:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我试过了

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

Tags: installhttpmitvareasyerrortarpeople
3条回答

似乎您尚未安装Portaudio。
您可以从Macports或自制软件中获取。

  • sudo port install portaudio
  • sudo brew install portaudio

或者用啤酒

brew install portaudio

它可能依赖于一些需要单独编译和安装的C库。就像提供“portaudio.h”的东西一样。大多数这些东西都是在linux上测试的,它的包管理器可以自动处理这类事情,而OS X是非免费的,必须绕过许可雷区。

相关问题 更多 >