无法安装 pyaudio,gcc 错误 [英] Cannot install pyaudio, gcc error
本文介绍了无法安装 pyaudio,gcc 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试按照此处的说明安装 pyaudio:
Trying to install pyaudio with instructions per here:
$ git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
$ cd pyaudio
$ sudo python setup.py install
running install
running build
running build_py
running build_ext
building '_portaudio' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:28:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:215:0: note: this is the location of the previous definition
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
我的安装出了什么问题?
What's going wrong in my installation?
推荐答案
抱歉上次回答不当,我会贴出问题的解决方案.它可能对 Ubuntu 发行版有所帮助.
Sorry about the inappropriate answer last time, I will post the solution of the question. It might be helpful for Ubuntu distributions.
首先我们需要安装portaudio模块:
sudo apt-get install libasound-dev
从以下位置下载 portaudio 存档:http://files.portaudio.com/download.html
Download the portaudio archive from: http://files.portaudio.com/download.html
解压存档:tar -zxvf [portaudio.tgz]
进入目录,然后运行:./configure &&制作
安装:sudo make install
最后:sudo pip install pyaudio
查看pyaudio的版本,应该是0.2.9
Check the version of pyaudio, it should be 0.2.9
这篇关于无法安装 pyaudio,gcc 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文