您的位置:首页 > 编程语言 > Python开发

使用bazel 编译tensorflow serving时报错:fatal error: Python.h: No such file or directory

2017-08-28 17:38 1441 查看
使用bazel 编译tensorflow serving时报错:fatal error: Python.h: No such file or directory

即:

____[2,911 / 3,824] Compiling external/org_tensorflow/tensorflow/core/ops/script_ops.cc

ERROR: /root/.cache/bazel/_bazel_root/9d2529a5716c088bd9c07f1c8e164988/external/org_tensorflow/tensorflow/python/BUILD:192:1: C++ compilation of rule '@org_tensorflow//tensorflow/python:numpy_lib' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE
-fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 108 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited
with status 1.

In file included from external/org_tensorflow/tensorflow/python/lib/core/numpy.cc:20:0:

external/org_tensorflow/tensorflow/python/lib/core/numpy.h:32:20: fatal error: Python.h: No such file or directory

 #include <Python.h>

                    ^

compilation terminated.

____Building complete.

____Elapsed time: 145.828s, Critical Path: 29.73s

解决方法:

安装python-devel即可,注意,不是python-dev

yum -y install python-devel

参考:
http://blog.csdn.net/tianxiajianling/article/details/6636204
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐