P4API.cpp:39:20: 致命错误:Python.h:没有那个文件或目录

3

在Linux机器上安装p4python时出现致命错误。

配置信息:

Python 2.7.5 操作系统:Fedora

在安装“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

----------------------------------------
1个回答

3

您需要安装类似于Python头文件的内容:

 yum install python-devel

链接不再可用。 对我来说这行不通。我已经安装了python-devel甚至是python3-devel,但仍然看到相同的错误。 - Durga Swaroop

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接