10

I have tried

easy_install pyaudio

and it doesn't work. I get the following:

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
mabdrabo
  • 1,050
  • 21
  • 35
gazzwi86
  • 1,019
  • 1
  • 15
  • 35

3 Answers3

21

It seems that you have not installed Portaudio.
You can get it from Macports or Homebrew.

  • sudo port install portaudio
  • sudo brew install portaudio
mabdrabo
  • 1,050
  • 21
  • 35
The Unfun Cat
  • 29,987
  • 31
  • 114
  • 156
  • Will this work with virtualenv? I would have thought it would be out of the python path Edit: sorry had a dumb moment! – gazzwi86 Nov 21 '12 at 17:29
  • 2
    Or with homebrew: `brew install portaudio` – Harry Maclean Jan 08 '14 at 20:41
  • 3
    If you're in a virtualenv (or using virtualenvwrapper), pyaudio will not find portaudio during install. [This answer](http://stackoverflow.com/a/10290595/1386245) helped me out tremendously. – tim-phillips Mar 03 '14 at 23:22
  • This answer was the easiest for me http://stackoverflow.com/questions/33513522/when-installing-pyaudio-pip-cannot-find-portaudio-h-in-usr-local-include – Jonathan Hendler May 31 '16 at 18:29
7

Or with brew

brew install portaudio
Gianfranco P.
  • 10,049
  • 6
  • 51
  • 68
2

It's probably dependent on some C library which needs to be compiled and installed separately. Like whatever provides 'portaudio.h'. Most of these things are tested on linux which has package managers that can take care of this sort of thing automagically whereas OS X is non-free and has to circumnavigate licensing minefields.

John Mee
  • 50,179
  • 34
  • 152
  • 186