0

I am using Python 2.7.12 in Ubuntu 16.04 LTS. I tried installing pyaudio and pygsr by using commands

sudo pip install -U pyaudio
sudo pip install -U pygsr

and I got the output (error) as below:

    Collecting pyaudio
  Downloading PyAudio-0.2.10.tar.gz (287kB)
    100% |████████████████████████████████| 296kB 762kB/s 
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Unc_F6/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-2uTcg2-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying src/pyaudio.py -> build/lib.linux-x86_64-2.7
    running build_ext
    building '_portaudio' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
    src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Unc_F6/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-2uTcg2-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Unc_F6/pyaudio/
1
  • maybe check this question Commented Mar 14, 2017 at 10:15

2 Answers 2

2

I solved this by using the following commands on ubuntu 16.04. Tested on python 3.7 and 3.5

sudo apt install portaudio19-dev python-pyaudio
pip install PyAudio

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! It worked with sudo apt install portaudio19-dev python3-pyaudio on Ubuntu 20.04
1

Well, I solved the problem by using the package manager,

 $ sudo apt-get install python-pyaudio

Although still has no clue why easy_install fails.

4 Comments

what about 'pygsr' module..??
it is included in the package :)
try this link pypi.python.org/pypi/pygsr if error still exist :)
while i am importing 'pygsr' it throws error like 'ImportError: No module named pygsr'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.