无法在 osx lion 上安装 pyaudio [英] Unable to install pyaudio on osx lion

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

问题描述

我想在 osx lion 上安装 pyaudio,但我无法做到.每次我尝试使用 pkg 时,它都不会安装任何东西.当我尝试使用 pip 安装它时,出现以下错误(在许多其他行中):

I'd like to install pyaudio on osx lion but i'm unable to do it. Everytime i try with the pkg, it doesn't install anything. When i try to install it with pip i have the following error (among a lot of other lines) :

lipo: can't open input file: /var/folders/11/gfpzwjdd6dj7hbz7dpbvx9y40000gn/T//ccYnQM1k.out (No such file or directory)

错误:命令/usr/bin/llvm-gcc"失败,退出状态为 1

error: command '/usr/bin/llvm-gcc' failed with exit status 1

如果有人可以帮助我,谢谢.

If anyone can help me, thank you.

推荐答案

我必须手动安装它才能正常工作.您将需要 pyaudio 和 portaudio 的源发行版.

I had to manually install it to get anything working. You'll need the source distributions for both pyaudio and portaudio.

首先我用 MacPorts 安装了 portaudio(不是来自源代码分发):

Firstly I installed portaudio with MacPorts (not from the source distribution):

sudo port install portaudio

pyaudio 然后拒绝安装,因为它找不到 pa_mac_core.h 和 portaudio.h 标头.将这些从 portaudio source distribution 复制到 pyaudio 的 src 文件夹,我不得不取消注释 pa_mac_core.h 的第 49 行:

pyaudio then refused to install as it couldn't find the pa_mac_core.h and portaudio.h headers. After copying these from the portaudio source distribution include folder into pyaudio's src folder, I had to uncomment line 49 of pa_mac_core.h:

#include <AudioToolbox/AudioToolbox.h>

这样做使我可以使用简单的方式安装 pyaudio

Doing this allowed me to get pyaudio to install using a simple

sudo python setup.py install

(我可能不需要超级用户来安装 portaudio,但 pyaudio 不会安装,除非我以超级用户身份安装)

(I probably didn't need superuser for the portaudio install, but pyaudio wouldn't install unless I did it as a superuser)

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

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