Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while upgrading PyAudio to latest version

I have PyAudio (0.2.7) installed in my system.

When I tried to upgrade using

sudo pip install pyaudio --upgrade

I'm getting this.

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

I'm using elementary os 14.04

What is the problem here?

like image 430
jophab Avatar asked Mar 09 '26 20:03

jophab


2 Answers

Thanks @Cristian Ciupitu for the advice to install portaudio-dev.

But portaudio-dev did not installed with sudo apt-get install portaudio-dev in my case. I got

E: Unable to locate package portaudio-dev 

How this was solved

  1. Downloaded the .tgz of portaudio file from here
  2. Then Extract the downloaded file.
  3. cd to the extracted folder.
  4. Then ./configure && make
  5. Now do sudo make install
  6. Then upgrade pyaudio by sudo pip install pyaudio --upgrade

Now pyaudio was successfully installed.

like image 128
jophab Avatar answered Mar 12 '26 09:03

jophab


run in terminal:

$ sudo apt install python3-pyaudio

like image 41
Matheus Fornazieri Avatar answered Mar 12 '26 09:03

Matheus Fornazieri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!