且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

导入 pyaudio 不起作用 - 找不到符号:Mac 上的 _PaMacCore_SetupChannelMap(Big Sur M1 Apple Silicon)

更新时间:2023-01-11 11:24:09

不知道您是否还需要解决方案,但经过数小时的谷歌搜索后,这是我的(我也拥有一台 Mac m1):

Don't know if you still need the solution, but here was mine after hours of googling (I also owned a Mac m1):

一开始我无法安装PyAudio,即使成功安装了PyAudio也遇到了问题.我使用了与 brew 一起安装的 python 3.9.

I could not install PyAudio at first and encountered problems even after I successfully installed PyAudio. I used python 3.9 installed with brew for the process.

  1. 卸载以前版本的 portaudio + PyAudio
  2. (可选)使用 Brew 主页上的命令安装 Mac m1 支持的最新 Brew
  3. (可选)安装wheel和setuptools:python3 -m pip install --upgrade pip setuptools wheel
  4. 安装最新版本的portaudio(我认为这是核心问题,稳定版19.6.0不起作用): brew install portaudio --HEAD
  5. 使用 pip 安装 PyAudio: python3 -m pip install pyaudio --global-option="build_ext";--global-option="-I/opt/homebrew/include";--global-option="-L/opt/homebrew/lib"

如果事情进展不顺利,重启终端可能会有所帮助.

Restart terminal might help if things did not go well.