Pyaudio, portaudio and mac 10.7.5

Leo Mizuhara picture Leo Mizuhara · Jan 25, 2013 · Viewed 9.9k times · Source

I'm having trouble installing pyaudio correctly. I have a virtualenv set up for the project. I first tried to install portaudio:

sudo port install portaudio

which returns:

--->  Cleaning portaudio
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

I assume that means it ran fine. Then I tried:

pip install pyaudio

Which returns:

Downloading/unpacking pyaudio
Running setup.py egg_info for package pyaudio

warning: no files found matching '*.c' under directory 'test'
Installing collected packages: pyaudio
Running setup.py install for pyaudio
building '_portaudio' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.6-intel-2.7/src/_portaudiomodule.o -fno-strict-aliasing
src/_portaudiomodule.c:29:23: error: portaudio.h: No such file or directory
src/_portaudiomodule.c:33:25: error: pa_mac_core.h: No such file or directory
...

Is that first warning a problem? I'm a bit surprised it's saying no file or directory for portaudio.h. Do I have to do something special to enable my port audio macport installation?

Appreciate any help!

Answer

synonymous picture synonymous · Apr 18, 2016
$ brew install portaudio
$ pip install pyaudio

Some missing libraries and such that portaudio provides. Works for Python 2.7 (not sure about other versions)