Skocz do zawartości

Pyaudio - Command 'gcc' Failed With Exit Status 1


Murt

Rekomendowane odpowiedzi

Witam

Jak w temacie, przy próbie instalacji PyAudio pip3 sypie błąd:

[root@murtrag portaudio]# pip3 install PyAudio
Collecting PyAudio
  Using cached PyAudio-0.2.10.tar.gz
Building wheels for collected packages: PyAudio
  Running setup.py bdist_wheel for PyAudio ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wluo1gih/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/tmp1hcw718lpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  copying src/pyaudio.py -> build/lib.linux-x86_64-3.5
  running build_ext
  building '_portaudio' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/src
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.5m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.5/src/_portaudiomodule.o
  src/_portaudiomodule.c:28:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  error: command '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/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wluo1gih/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-qqe1uvoj-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    copying src/pyaudio.py -> build/lib.linux-x86_64-3.5
    running build_ext
    building '_portaudio' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.5m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.5/src/_portaudiomodule.o
    src/_portaudiomodule.c:28:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wluo1gih/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-qqe1uvoj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-wluo1gih/PyAudio/

Nie wiem jak sobie z tym poradzić.

Ps:

Fedora 24, Python 3.5.2, pip 9.0.1
 

Odnośnik do komentarza
Udostępnij na innych stronach

Nie wiem jak sobie z tym poradzić.

Ps:

Fedora 24, Python 3.5.2, pip 9.0.1

 

Komunikat jest dość jasny "fatal error: Python.h: No such file or directory".

Musisz doinstalować python3-devel, nie wiem jak f24, ale w f25 pyaudio jest jest w repozytorium i nie trzeba samodzielnie kompilować.

Odnośnik do komentarza
Udostępnij na innych stronach

Do postów doświadczonych kolegów dodam oczywistą radę - przed otwieraniem nowego (starego!!!) tematu należy wpisać w wyszukiwarce Google hasło "python.h". Najobszerniejsza dyskusja na ten temat jest w witrynie "http://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory".

Odnośnik do komentarza
Udostępnij na innych stronach

Mam lepszy pomysł. Skoro Fedora 25 ma pyaudio zarówno dla py2 i py3, możesz też ściągnąć pakiet źródłowy ftp://ftp.icm.edu.pl/vol/rzm5/linux-fedora/linux/releases/25/Everything/source/tree/Packages/p/pyaudio-0.2.9-3.fc25.src.rpm i przebudować go u siebie. Unikniesz śmiecenia pipem w /usr/lib i będziesz miał też pewność, że wszystkie zależności są w porządku.

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
×
×
  • Dodaj nową pozycję...