本文介绍了无法在Google Colab上安装pyaudio,并显示“错误:pyaudio的构建轮失败";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在Google Colab上安装pyaudio,但出现错误错误:pyaudio的构建轮失败".

Trying to install pyaudio on Google Colab but got an error "ERROR: Failed building wheel for pyaudio".

!apt install libasound2-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg libav-tools
!pip 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
  Building wheel for pyaudio (setup.py) ... error
  ERROR: 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
ERROR: Command "/usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-000dzv_9/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-tvs_aja7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-000dzv_9/pyaudio/

推荐答案

我只需要从apt install中删除libav-tools,然后再次运行此命令即可.

I just need to remove libav-tools from apt install and run this command again.

!apt install libasound2-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg

现在pyaudio已成功安装.

Now pyaudio is installed successfully.

这篇关于无法在Google Colab上安装pyaudio,并显示“错误:pyaudio的构建轮失败";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 04:43