I'm trying to import pyaudio on my Macbook with M1 chip. I have python version 3.9.6 and anaconda (python 3.8), and now using version on terminal is 3.9.6.
Before I get this error, I fixed 'brew install portaudio' & 'pip install pyaudio' problem. Portaudio & Pyaudio installed fine! But when I try to import pyaudio,
Could not import the PyAudio C module '_portaudio'.
Traceback (most recent call last):
File "/Users/hson/Desktop/k.A.I_speaker/test.py", line 2, in <module>
import make_pyaudio
File "/Users/hson/Desktop/k.A.I_speaker/make_pyaudio.py", line 1, 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
I tried uninstall portaudio&pyaudio and reinstall many times, but still I could not fix this problem.
Does anyone who get this problem and fix it?
"conda install portaudio pyaudio" worked on my m1 mac
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With