Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install pyaudio in google colab

While I'm trying to run pip install PyAudio, I'm seeing the following error:

  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 errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o_0h_bmo/PyAudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o_0h_bmo/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-8_ovxdkm/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
like image 239
Abdun Noor Polok Avatar asked Feb 28 '21 19:02

Abdun Noor Polok


People also ask

Does Python 3.7 support PyAudio?

pyaudio is not supported with python 3.7.

What version of Python does PyAudio use?

Note: As of this update, PyAudio is compatible with Python 2.6, Python 2.7, and Python 3.2. For Python installations older than 2.6, use PyAudio 0.2. 4.


1 Answers

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

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

and then

!pip install PyAudio

You will be able to install it.

like image 122
Prabhat Kumar Sahu Avatar answered Sep 30 '22 04:09

Prabhat Kumar Sahu