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

使用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
                    ^
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

你可能感兴趣的:(Linux,tensorflow,serving,docker)