繁体   English   中英

PyAudio 的构建轮失败(M1 芯片)

[英]Failed building wheel for PyAudio (M1 chip)

当我尝试使用以下命令在我的 MAC (M1) 上安装 PyAudio 时:

pip install PyAudio

我收到以下错误:

Collecting PyAudio
  Using cached PyAudio-0.2.12.tar.gz (42 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
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
  ╰─> [16 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-39
      copying src/pyaudio.py -> build/lib.macosx-10.9-universal2-cpython-39
      running build_ext
      building '_portaudio' extension
      creating build/temp.macosx-10.9-universal2-cpython-39
      creating build/temp.macosx-10.9-universal2-cpython-39/src
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DMACOSX=1 -I/usr/local/include -I/usr/include -I/Users/dusankovacevic/Desktop/doctrina/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c src/_portaudiomodule.c -o build/temp.macosx-10.9-universal2-cpython-39/src/_portaudiomodule.o
      src/_portaudiomodule.c:30:10: fatal error: 'Python.h' file not found
      #include "Python.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: Could not build wheels for PyAudio, which is required to install pyproject.toml-based projects

我已经安装了 brew installed portaudio:/ 并且我正在 venv 中工作,在那里我安装了 pyenv install 3.9-dev。 任何帮助表示赞赏!

 try sudo apt update sudo apt install portaudio19-dev pip install pyaudio

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM