gpt4 book ai didi

python - 将 PyAudio 升级到最新版本时出错

转载 作者:行者123 更新时间:2023-11-28 19:53:51 27 4
gpt4 key购买 nike

我的系统中安装了 PyAudio (0.2.7)

当我尝试升级时使用

sudo pip install pyaudio --upgrade

我明白了。

Downloading/unpacking pyaudio from https://pypi.python.org/packages/44/39/f3b9b16d32cc8588fa06bb2e813cea35363f5502117cd6cc7f619b556d9f/PyAudio-0.2.10.tar.gz#md5=b65354d997fa00a9166f8dbcb83075e6
Downloading PyAudio-0.2.10.tar.gz (287kB): 287kB downloaded
Running setup.py (path:/tmp/pip_build_root/pyaudio/setup.py) egg_info for package pyaudio

Installing collected packages: pyaudio
Found existing installation: PyAudio 0.2.7
Not uninstalling PyAudio at /usr/lib/python3/dist-packages, owned by OS


.......
.......

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.4/src/_portaudiomodule.o

src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory

#include "portaudio.h"

^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Can't roll back PyAudio; was not uninstalled
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ih3i9qsm-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pyaudio
Storing debug log for failure in /home/jobin/.pip/pip.log

我正在使用 elementary os 14.04

这里有什么问题?

最佳答案

感谢@Cristian Ciupitu 建议安装 portaudio-dev

但在我的例子中,portaudio-dev 没有安装 sudo apt-get install portaudio-dev。我得到了

E: Unable to locate package portaudio-dev 

这是如何解决的

  1. here下载了portaudio 文件的.tgz
  2. 然后解压缩下载的文件。
  3. cd 到解压缩的文件夹。
  4. 然后./configure && make
  5. 现在执行sudo make install
  6. 然后通过sudo pip install pyaudio --upgrade升级pyaudio

至此pyaudio安装成功。

关于python - 将 PyAudio 升级到最新版本时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42038991/

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