gpt4 book ai didi

python - 无法安装pyaudio,gcc错误

转载 作者:太空狗 更新时间:2023-10-29 17:09:24 26 4
gpt4 key购买 nike

尝试按照说明安装 pyaudio 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

我的安装出了什么问题?

最佳答案

抱歉上次回答不当,我会贴出问题的解决方法。它可能对 Ubuntu 发行版有帮助。

  1. 首先我们需要安装 portaudio 模块:sudo apt-get install libasound-dev

  2. 从以下位置下载 portaudio 存档:http://files.portaudio.com/download.html

  3. 解压缩文件:tar -zxvf [portaudio.tgz]

  4. 进入目录,然后运行:./configure && make

  5. 安装:sudo make install

  6. 最后:sudo pip install pyaudio

  7. 查看pyaudio的版本,应该是0.2.9

关于python - 无法安装pyaudio,gcc错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20023131/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com