Abstract
I had a chance to write a program to play wav
files using Python, so I was addicted to setting the environment, so I will make a note of it.
PyAudio Official showed how to install for Mac OSX.
$ brew install portaudio
$ pip install pyaudio
When I tried to install pyaudio
esrc/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-vceQ5Y/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ugKOpS-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-vceQ5Y/pyaudio/Q5Y/pyaudio/
I got the error.
It looks like I couldn't find portaudio.h
. ~~ I put it in properly. ~~
It seemed like I should explicitly specify the files that have dependencies.
$ sudo pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
Reference -[Qiita] A workaround when installing pyAudio with pip. --Installing portaudio using mac port
-[Qiita] Code block when writing console (shell) command execution in Qiita --Code block notation ...
Recommended Posts