无法在M1 Mac上安装PyAudio[已安装PortAudio] [英] Unable to install PyAudio on M1 Mac [PortAudio already installed]

查看:36
本文介绍了无法在M1 Mac上安装PyAudio[已安装PortAudio]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我访问了许多论坛,尝试了不同的方法,如BREW、PIP、PORT等,但仍然遇到相同的错误。

View this Image for more detail

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

有人能帮忙吗?

推荐答案

此解决方案在M1 Mac上进行了测试[请与其他计算机核对]。

在系统上安装HOMEBREW后,执行PortAudio安装。接下来,请执行下面提到的步骤:

使用命令安装PortAudio

sudo BREW安装端口音频

成功安装PortAudio后,输入以下命令。

sudo Nano$HOME/.pydistutils.cfg

接下来,在打开的窗口中输入以下行

[build_ext]
include_dirs=/Users/<enter-your-system-username>/homebrew/Cellar/portaudio/19.20140130/include/
include_dirs=/Users/<enter-your-system-username>/homebrew/Cellar/portaudio/19.20140130/lib/

注意:您的PortAudio位置可能不同,而且不要忘记替换您的电脑用户名。

最终运行命令

pip安装pydio

PIP3安装pydio

这篇关于无法在M1 Mac上安装PyAudio[已安装PortAudio]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆