python - P4API.cpp :39:20: fatal error: Python. h: 没有那个文件或目录

标签 python linux fedora p4python

在 Linux 机器上安装 p4python 时出现 fatal error 。

配置:

python 2.7.5 操作系统:软呢帽

以下是我在安装“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

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

最佳答案

您需要安装 python header文件类似于:

 yum install python-devel

关于python - P4API.cpp :39:20: fatal error: Python. h: 没有那个文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30641311/

相关文章:

fedora - 如何更改 Fedora 22 中的 GDM 登录背景?

python - 属性错误: 'Image' object has no attribute 'new' occurs when trying to use Pytorchs AlexNet Lighting preprocessing

python - Python 中的类继承问题

python - 我们是否应该始终用列表理解替换 for 循环

python - 如何比较一列中的字符串值,逐一分组

linux -/etc/passwd的语法意义是什么

linux - 使用 grep 命令指定特定年份之间的日期

c - windows上的代码文件如何与WSL/linux同步?

java - crontab 在 linux 上运行 java shell 脚本

docker - 如何使用 openshift 调试容器镜像