I have been trying to install PyAudio for a while. I have installed PortAudio using Homebrew.
I used pip3 install pyaudio
and pip install pyaudio
to attempt to install but it is throwing an error.
Error:
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/z8/0zm6rvc13sq26xhp_lkxqjbm0000gn/T/pip-install-ctufc1pe/pyaudio_f78c4d14ac984d9bbe4ecda8dee42097/setup.py'"'"'; __file__='"'"'/private/var/folders/z8/0zm6rvc13sq26xhp_lkxqjbm0000gn/T/pip-install-ctufc1pe/pyaudio_f78c4d14ac984d9bbe4ecda8dee42097/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' build_ext -I/usr/local/include -L/usr/local/lib install --record /private/var/folders/z8/0zm6rvc13sq26xhp_lkxqjbm0000gn/T/pip-record-tgzbcyw5/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio
cwd: /private/var/folders/z8/0zm6rvc13sq26xhp_lkxqjbm0000gn/T/pip-install-ctufc1pe/pyaudio_f78c4d14ac984d9bbe4ecda8dee42097/
Complete output (11 lines):
running build_ext
building '_portaudio' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.9/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
I have even used pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
I have no idea how to proceed further.
Is there any way to solve this?