Fay icon indicating copy to clipboard operation
Fay copied to clipboard

求助, pip install 报错 build pyaudio 失败

Open yswjdwn1st opened this issue 10 months ago • 2 comments

报错详情如下

Building wheels for collected packages: pyaudio
  Building wheel for pyaudio (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pyaudio (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build/lib.macosx-10.9-universal2-cpython-312/pyaudio
      copying src/pyaudio/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/pyaudio
      running build_ext
      building 'pyaudio._portaudio' extension
      creating build/temp.macosx-10.9-universal2-cpython-312/src/pyaudio
      clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -arch arm64 -arch x86_64 -g -DMACOS=1 -I/usr/local/include -I/usr/include -I/opt/homebrew/include -I/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c src/pyaudio/device_api.c -o build/temp.macosx-10.9-universal2-cpython-312/src/pyaudio/device_api.o
      src/pyaudio/device_api.c:9:10: fatal error: 'portaudio.h' file not found
          9 | #include "portaudio.h"
            |          ^~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyaudio)

yswjdwn1st avatar Mar 12 '25 07:03 yswjdwn1st

pyaudio 依赖 portAudio,需要先安装

# mac
brew install portaudio 

chemistwang avatar Mar 14 '25 04:03 chemistwang