Elad Weiss
Elad Weiss

Reputation: 3992

Very strange error when building tensorflow on RedHat

Trying to build TensorFlow as instructed here:

https://www.tensorflow.org/install/install_sources

Strangely getting error:

ERROR: /home/eladw/.cache/bazel/_bazel_eladw/dbbd970aeeecbb3cd584d511cefda723/external/protobuf_archive/BUILD:642:1: C++ compilation of rule '@protobuf_archive//:python/google/protobuf/internal/_api_implementation.so' failed (Exit 1).
     external/protobuf_archive/python/google/protobuf/internal/api_implementation.cc:31:20: fatal error: Python.h: No such file or directory
#include <Python.h>

Even though I have python-dev installed.

Package python-devel-2.7.5-48.el7.x86_64 already installed and latest version
Nothing to do

Any ideas?

Upvotes: 0

Views: 577

Answers (2)

tgoodhart
tgoodhart

Reputation: 3266

I received this error when I did a yum install python36-devel after I had already started a bazel build. The ./bazel-tensorflow/external/local_config_python/BUILD had already cached an incomplete list of headers. bazel clean then re-running the build fixed the issue for me.

Upvotes: 1

HUSMEN
HUSMEN

Reputation: 366

This answer doesn't apply to your case exactly but it will be helpful for those who come across this in the future.

I faced the same problem but on a more recent version of the stack. The problem in my case was due to a change in Python 3.7 C API used by protobuf, downgrading to Python 3.6 solves the problem. more info here and here.

Upvotes: 0

Related Questions