-1

I've upgraded pip to 19.0.3. Then I removed pip==19.0.3 and reinstalled pip9.0.1. Now every time I try to install anything this message keeps coming up.

You are using pip version 9.0.1, however, version 19.0.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

Please help me out. Also i'm not able to install any more python packages.

pip install pyAudio


> Collecting pyAudio   Using cached
> https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
> Building wheels for collected packages: pyAudio   Running setup.py
> bdist_wheel for pyAudio ... error   Complete output from command
> /usr/bin/python -u -c "import setuptools,
> tokenize;__file__='/tmp/pip-build-sBep_e/pyAudio/setup.py';f=getattr(tokenize,
> 'open', open)(__file__);code=f.read().replace('\r\n',
> '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d
> /tmp/tmpJr7LNvpip-wheel- --python-tag cp27:   running bdist_wheel  
> 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 -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -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:10: 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
>      ----------------------------------------   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
>     Complete output from command /usr/bin/python -u -c "import setuptools,
> tokenize;__file__='/tmp/pip-build-sBep_e/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-72KZyy-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 -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -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:10: 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
>     
>     ---------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sBep_e/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-72KZyy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-sBep_e/pyAudio/ You are using pip version 9.0.1,
> however version 19.0.3 is available. You should consider upgrading via
> the 'pip install --upgrade pip' command.
Tony JOSE
  • 1
  • 5
  • you need to install whatever package provides `portaudio.h` ... I dont think this problem is with pip ... see https://stackoverflow.com/a/35593426/541038 – Joran Beasley Apr 05 '19 at 04:26

4 Answers4

1

Installing pydev solved 'x86_64-linux-gnu-gcc' error for me!

easy as:

sudo apt-get install python-dev 

You may also need build-essential for similar issues,

sudo apt-get install build-essential

Hope this helps.

Moss
  • 357
  • 1
  • 6
0

You need to install portaudio dev package:

  1. Download binary files of portaudio from here
  2. Extract it to somewhere
  3. in terminal go to that directory (with cd /where/you/extract/those)
  4. run this command there: ./configure
  5. run this: make
  6. and this one: sudo make install

now you can install portaudio with pip:

$ sudo pip install pyAudio

Installing collected packages: pyAudio
  Running setup.py install for pyAudio ... done
Successfully installed pyAudio-0.2.11
Mojtaba Kamyabi
  • 3,440
  • 3
  • 29
  • 50
0

Try this sudo apt-get install python-pyaudio. Thhis should work!

Banks
  • 179
  • 13
  • Thank you. Your code had helped me to install PyAudio. True. But the real problem was the pip problem – Tony JOSE Apr 24 '19 at 09:46
  • @TonyJOSE Just so you know the problem wasn't with pip. The problem was with `'x86_64-linux-gnu-gcc'`. That has been pointed out by Moss and Joran. – Banks May 16 '19 at 05:33
-1

The only thing you need to do is upgrading the pip utility to latest version by using one these commands

pip install pip setuptools -U 

or

pip install --upgrade pip

Note: You may need to add 'sudo' as prefix, if you're working on system level python installation.

Akay Nirala
  • 1,136
  • 7
  • 13
  • Successfully installed pip 19.0.3 ,but when i do pip --version, i get Traceback (most recent call last): File "/usr/bin/pip", line 9, in from pip import main ImportError: cannot import name main – Tony JOSE Apr 05 '19 at 05:41
  • Sorry to say but What you asked and what you choose as the best answer is completely different. You asked about PIP up-gradation issue and what you flag as best answer is How to install PyAudio? I mean Just think once before posting the question that what sort of help you actually need. – Akay Nirala Apr 05 '19 at 06:06
  • Thank you, I am sorry if I have hurt your feelings. I am new to stackoverflow. I had issues both on pip and pyaudio. But my concern is more on pip install. – Tony JOSE Apr 05 '19 at 07:07