Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install pyaudio, gcc error

Tags:

python

pyaudio

Trying to install pyaudio with instructions per here:

$ git clone http://people.csail.mit.edu/hubert/git/pyaudio.git $ cd pyaudio $ sudo python setup.py install running install running build running build_py running build_ext building '_portaudio' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o In file included from /usr/include/python2.7/Python.h:8:0,                  from src/_portaudiomodule.c:28: /usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default] /usr/include/features.h:215:0: note: this is the location of the previous definition src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 

What's going wrong in my installation?

like image 730
Mittenchops Avatar asked Nov 16 '13 20:11

Mittenchops


People also ask

Does Python 3.7 support PyAudio?

pyaudio is not supported with python 3.7.


2 Answers

Sorry about the inappropriate answer last time, I will post the solution of the question. It might be helpful for Ubuntu distributions.

  1. First we need to install portaudio modules: sudo apt-get install libasound-dev

  2. Download the portaudio archive from: http://files.portaudio.com/download.html

  3. Unzip the archive: tar -zxvf [portaudio.tgz]

  4. Enter the directory, then run: ./configure && make

  5. Install: sudo make install

  6. And finally: sudo pip install pyaudio

  7. Check the version of pyaudio, it should be 0.2.9

like image 57
AI_ROBOT Avatar answered Sep 20 '22 16:09

AI_ROBOT


This worked for me:

sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 sudo apt-get install ffmpeg libav-tools sudo pip install pyaudio 
like image 34
sayantan ghosh Avatar answered Sep 19 '22 16:09

sayantan ghosh