Trying to install pyaudio on Google Colab but got an error “ERROR: Failed building wheel for pyaudio”.
JavaScript
x
3
1
!apt install libasound2-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg libav-tools
2
!pip install pyaudio
3
I got this error:
JavaScript
1
11
11
1
Collecting pyaudio
2
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
3
Building wheels for collected packages: pyaudio
4
Building wheel for pyaudio (setup.py) error
5
ERROR: Failed building wheel for pyaudio
6
Running setup.py clean for pyaudio
7
Failed to build pyaudio
8
Installing collected packages: pyaudio
9
Running setup.py install for pyaudio error
10
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('"'"'rn'"'"', '"'"'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/
11
Advertisement
Answer
I just need to remove libav-tools
from apt install
and run this command again.
JavaScript
1
2
1
!apt install libasound2-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg
2
Now pyaudio is installed successfully.