Mac pip install pyaudio 失败的解决方法

...
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11.2-x86_64-3.7
  copying src/pyaudio.py -> build/lib.macosx-11.2-x86_64-3.7
  running build_ext
  building '_portaudio' extension
  creating build/temp.macosx-11.2-x86_64-3.7
  creating build/temp.macosx-11.2-x86_64-3.7/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DMACOSX=1 -I/Users/yuanxingyou/.pyenv/versions/3.7.10/include/python3.7m -c src/_portaudiomodule.c -o build/temp.macosx-11.2-x86_64-3.7/src/_portaudiomodule.o
  src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
  #**include "portaudio.h"**
           ^~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyaudio

这是由于缺少portaudio导致的,使用如下命令安装portaudio

brew install portaudio

brew是Mac软件包管理器,没有的话

使用ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"来安装

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>