I have been trying to install pyaudio
on a Mac M1 Big Sur but was not able to do so and was stuck on the 'portaudio.h' file not found
error.
I managed to install it using a different pip command: pip install --global-option='build_ext' --global-option='-I/opt/homebrew/include' --global-option='-L/opt/homebrew/lib' pyaudio
.
However, after installing when I try to run a script involving pyaudio
, the script throws the following error:
Could not import the PyAudio C module '_portaudio'.
Traceback (most recent call last):
File "path/test.py", line 14, in <module>
import pyaudio
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyaudio.py", line 116, in <module>
import _portaudio as pa
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_portaudio.cpython-39-darwin.so, 2): Symbol not found: _PaMacCore_SetupChannelMap
Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_portaudio.cpython-39-darwin.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_portaudio.cpython-39-darwin.so
Can someone help me with this? I have attempted the solution from this question, but the problem persists.