1

I tried to pip install pyaudio on my Macbook pro M1 Chip version. I was be able to install both portaudio and pyaudio successfully and then when I import pyaudio, I met an import error as below

(test) oldman@oldman-MacBook-Pro ~ % python3 
Python 3.8.8 (v3.8.8:024d8058b0, Feb 19 2021, 08:48:17) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyaudio 
Could not import the PyAudio C module 'pyaudio._portaudio'.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/oldman/test/lib/python3.8/site-packages/pyaudio/__init__.py", line 111, in <module>
    import pyaudio._portaudio as pa
ImportError: dlopen(/Users/oldman/test/lib/python3.8/site-packages/pyaudio/_portaudio.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_PaMacCore_SetupChannelMap'

The issue is similar to the one in Import pyaudio doesn't work - Symbol not found: _PaMacCore_SetupChannelMap on mac (Big Sur M1 Apple Silicon). I tried all the solutions provided under that issue, but none of them works. I am wondering if anyone have the similar issue and I am not sure what goes wrong as the latest solution they provided is in 2022. Not sure if anything change during this time. Thank you in advance!

  • For me it was fixing the version to pyaudio==0.2.12 as suggested [here]( https://stackoverflow.com/a/76404424) what worked. For you, too? – Marcus V. Aug 27 '23 at 20:55

1 Answers1

-2

It seems that you are encountering an issue with importing the PyAudio C module on your MacBook Pro with an M1 chip. This issue has been reported by other users as well. One solution that has worked for some users is to uninstall the previous versions of portaudio and PyAudio, update brew, upgrade the wheel and setuptools, and then install the latest version of portaudio using brew install portaudio --HEAD before installing PyAudio with pip2. Another user reported that running conda install portaudio pyaudio worked on their M1 Mac1.

Und3fined.

Und3fined
  • 9
  • 2