我的 MacBook Air m1 在安装 pyaudio 时出错

问题描述

pip 安装 pyaudio

我的 MacBook Air m1 在安装 pyaudio 时出错

我尝试使用自制软件,但它也有错误

ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/private/var/folders/sf/rd5x7wwj2wz54ytngnkpdjqr0000gn/T/pip-install-cisxlf7j/pyaudio_f393fd80f38a44d4a4e84c93d43af064/setup.py'"'"'; __file__='"'"'/private/var/folders/sf/rd5x7wwj2wz54ytngnkpdjqr0000gn/T/pip-install-cisxlf7j/pyaudio_f393fd80f38a44d4a4e84c93d43af064/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' install --record /private/var/folders/sf/rd5x7wwj2wz54ytngnkpdjqr0000gn/T/pip-record-s62r2u6s/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio
         cwd: /private/var/folders/sf/rd5x7wwj2wz54ytngnkpdjqr0000gn/T/pip-install-cisxlf7j/pyaudio_f393fd80f38a44d4a4e84c93d43af064/
    Complete output (16 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.9
    copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.9
    running build_ext
    building '_portaudio' extension
    creating build/temp.macosx-10.9-x86_64-3.9
    creating build/temp.macosx-10.9-x86_64-3.9/src
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.9/src/_portaudiomodule.o
    src/_portaudiomodule.c:29:10: Fatal error: 'portaudio.h' file not found
    #include "portaudio.h"
             ^~~~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/gcc' Failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import sys,'"'"'exec'"'"'))' install --record /private/var/folders/sf/rd5x7wwj2wz54ytngnkpdjqr0000gn/T/pip-record-s62r2u6s/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio Check the logs for full command output.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)