1

I have python 3.6.8 installed on CentOS7 and I'm trying to install pyaudio with

sudo python3.6 -m pip install pyaudio

This format worked to install a number of other things right beforehand, but if I try to use it here i get the following error

src/_portaudiomodule.c:28:10: fatal error: Python.h: No such file or directory
 #include "Python.h"
          ^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------

pip install pyaudio yeilds the same results

I have read the question and answer here but I still cannot figure it out

Any advice in installation? Thank you in advance!

1 Answers1

0

fatal error: Python.h: No such file or directory

It looks like pyaudio is compiling some C code who require Python.h, to fix your issue check this answer https://stackoverflow.com/a/21530768/9799292

(also, "pip install pyaudio" prints "bash: pip: command not found")

To fix this try to install pip by running this command

sudo yum install python3-pip
Mathix420
  • 872
  • 11
  • 21
  • I got the python3-devel installed and the pip issue resolved but I'm struggling with portaudio.h now... When I do sudo yum install portaudio or portaudio-dev or -devel or portaudio19-dev it says it can't find the package – Ian Charles May 28 '20 at 02:07