3

Getting fatal error while installing p4python on linux machine.

configuration:

Python 2.7.5 os : fedora

Below is the message I am getting while installing "p4python":

 $ pip install p4python
creating build/lib.linux-x86_64-2.7

copying P4.py -> build/lib.linux-x86_64-2.7

running build_ext

building 'P4API' extension

creating build/temp.linux-x86_64-2.7

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DID_OS="LINUX31X86_64" -DID_REL="2015.1.MAIN" -DID_PATCH="1058604" -DID_API="2015.1/1054991" -DID_Y="2015" -DID_M="05" -DID_D="12" -I/tmp/p4api-2015.1.1054991 -I/tmp/p4api-2015.1.1054991/include/p4 -I/usr/include/python2.7 -c P4API.cpp -o build/temp.linux-x86_64-2.7/P4API.o -DOS_LINUX -DOS_LINUX31 -DOS_LINUXX86_64 -DOS_LINUX31X86_64

P4API.cpp:39:20: fatal error: Python.h: No such file or directory

 #include <Python.h>

                    ^

compilation terminated.

error: command 'gcc' failed with exit status 1

----------------------------------------
neo
  • 969
  • 1
  • 11
  • 23

1 Answers1

3

You need to install the python header files something like:

 yum install python-devel
Padraic Cunningham
  • 176,452
  • 29
  • 245
  • 321
  • The link is no longer available. And this doesn't work for me. I've installed `python-devel` and even `python3-devel` but still seeing the same error. – Durga Swaroop Sep 23 '21 at 15:07