command 'x86_64-linux-gnu-gcc',Ubuntu16.04 pip3 install PyAudio 出错:error: command 'x86_64-...

错误信息Collecting pyaudio Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz Building wheels for collected packages: pyaudio Running setup.py bdist_wheel for pyaudio ... error Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kg54s8cx/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-nwzkkq3_ --python-tag cp35: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.5 copying src/pyaudio.py -> build/lib.linux-x86_64-3.5 running build_ext building '_portaudio' extension creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/src x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.5/src/_portaudiomodule.o src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for pyaudio Running setup.py clean for pyaudio Failed to build pyaudio Installing collected packages: pyaudio Running setup.py install for pyaudio ... error Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kg54s8cx/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-1k4o92s5/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.linux-x86_64-3.5 copying src/pyaudio.py -> build/lib.linux-x86_64-3.5 running build_ext building '_portaudio' extension creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/src x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.5/src/_portaudiomodule.o src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kg54s8cx/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-1k4o92s5/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-kg54s8cx/pyaudio/

执行下面命令

root@robot:/home/liu# pip3 install pyaudio Collecting pyaudio Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz Building wheels for collected packages: pyaudio Running setup.py bdist_wheel for pyaudio ... done Stored in directory: /root/.cache/pip/wheels/f4/a8/a4/292214166c2917890f85b2f72a8e5f13e1ffa527c4200dcede Successfully built pyaudio Installing collected packages: pyaudio Successfully installed pyaudio-0.2.11

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 这个错误通常与编译代码有关。错误消息表明在编译过程中发生了错误,命令'x86_64-linux-gnu-gcc'返回了1的退出状态码。 有几种可能的原因导致编译错误。其中一种可能是您的代码存在语法错误或其他问题,使得编译器无法编译。另一种可能性是您的编译环境没有正确配置或缺少必要的依赖项。 要解决这个问题,您可以首先检查代码中是否存在语法错误或其他问题。您还可以检查您的编译环境是否配置正确,并确保您有所有必要的依赖项。如果问题仍然存在,您可以尝试搜索错误消息以获取更多信息,并查找其他人是否遇到过类似的问题并提供了解决方案。 ### 回答2: 这个错误提示是在使用Python的pip安装某个软件包时出现的,通常是因为缺少相关的开发库或编译器。 具体地说,'x86_64-linux-gnu-gcc'是C语言编译器,用于编译C语言程序。如果缺少该编译器,或者编译器与操作系统不兼容,就会出现该错误。 要解决这个问题,有几种可能的方法: 1. 安装相关开发库。根据错误信息提示的操作系统和编译器名称,查找相应的lib和dev软件包,使用apt-get等包管理器进行安装。 2. 升级或切换Python版本。如果使用的Python版本过旧或者不兼容,也可能会导致编译错误。可以尝试升级到最新版本或者使用其他版本的Python。 3. 不使用pip安装,手动编译安装。如果无法解决依赖问题,可以手动下载源代码,进行编译安装。 4. 使用虚拟环境。为了避免依赖冲突和版本不兼容等问题,可以使用虚拟环境独立安装软件包,并确保环境中包含所需的开发库和编译器。 总之,解决'x86_64-linux-gnu-gcc'失败的问题需要结合具体情况进行分析,仔细查阅错误信息和相关文档,采取适合的解决方法。 ### 回答3: 这是一个编译错误,通常是由于缺少必要的库或编译器导致的。该错误通常会在使用Python包时出现,因为大多数Python包都要编译C扩展模块。 要解决此错误,您可以尝试以下步骤: 1. 确保您已经安装了必要的库和编译器,例如gcc、make、libc-dev等。在Ubuntu系统上,您可以通过运行以下命令来安装这些库和编译器: sudo apt-get install gcc make libc-dev 2. 检查是否缺少所需的库或头文件。如果缺少库或头文件,需要安装它们。你可以尝试在系统上搜索相应的名称,然后安装它们。例如,在Ubuntu系统上,您可以通过以下命令来搜索和安装名称为“zlib”的库: sudo apt-cache search zlib sudo apt-get install zlib1g-dev 3. 如果您使用Anaconda或其他Python发行版,请确保您已经安装了所需的软件包。有些软件包需要在系统级别(例如libxml2)上安装,而其他软件包则可以通过Python包管理器pip安装。 4. 您还可以尝试从源代码编译软件包,而不是从预编译的二进制文件安装。这将确保软件包与您的系统和库版本兼容,并可能解决编译错误。您可以在Python包源码存储库中查找软件包源代码。 总之,错误“command 'x86_64-linux-gnu-gcc' failed with exit status 1”表示编译过程遇到了错误。您需要检查系统和软件包配置,确定是否缺少必要的库和编译器,并尝试通过从源代码编译软件包来解决编译错误。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值