使用macOs Sierra安装pyaudio [英] install pyaudio with macOs Sierra
问题描述
我将Mac升级到了macOS Sierra,因此我不得不开设一个新帐户.目前,我正在尝试建立自己的环境.我在安装pyaudio时遇到问题.我使用的过程是首先使用自制程序并安装端口音频.
I upgraded my Mac to macOS Sierra and I had to start a new account. Right now I am trying to establish my environment. I ran into a problem installing pyaudio. The procedure I used is first use homebrew and install port audio.
brew install portaudio
它安装没有错误.
我继续使用pip安装pyaudio
I proceed to install pyaudio using pip
pip install pyaudio
我收到以下错误消息.
I receive the following error message.
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DMACOSX=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.12-intel-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^
1 error generated.
error: command 'cc' failed with exit status 1
portaudio.h is available in /usr/local/Cellar/portaudio/19.20140130/include
我不熟悉pip,也不知道如何将路径传递给编译器.
I am unfamiliar with pip and don't know how to pass the path to the complier.
任何帮助将不胜感激.
谢谢
杆
推荐答案
感谢您的建议.我尝试过,但是没有用. 尝试在macOS Sierra中安装时,pip似乎没有同时找到包含文件和库
Thanks for the suggestion. I tried it but it did not work. It seems pip is not finding both include files and libraries when attempting to install in macOS Sierra
我深入研究了如何通过pip传递路径,并使用以下命令成功安装了pyaudio.
I did some digging into how to pass paths with pip and I successfully installed pyaudio using the following command.
sudo pip -v install --global-option=build_ext --global-option="-I/usr/local/Cellar/portaudio/19.20140130/include" --global-option="-L/usr/local/opt/portaudio/lib" pyaudio
这篇关于使用macOs Sierra安装pyaudio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!