Usually this error appears when I try to build an example in tensorflow serving repository.
The command is as follows,
bazel build //tensorflow_serving/example:grpc_client
Error looks like as follows,
WARNING: /home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/tensorflow/workspace.bzl:128:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
ERROR: /home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/util/python/BUILD:5:1: no such package '@local_config_python//': Traceback (most recent call last):
File "/home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/third_party/py/python_configure.bzl", line 180
_create_python_repository(repository_ctx)
File "/home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/third_party/py/python_configure.bzl", line 157, in _create_python_repository
_get_env_var(repository_ctx, _PYTHON_BIN_PATH)
File "/home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/third_party/py/python_configure.bzl", line 48, in _get_env_var
_python_configure_fail("'%s' environment variable is no...)
File "/home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/third_party/py/python_configure.bzl", line 36, in _python_configure_fail
fail("
%sPython Configuration Error:%...))
Python Configuration Error: 'PYTHON_BIN_PATH' environment variable is not set
and referenced by '@org_tensorflow//util/python:python_headers'.
ERROR: Analysis of target '//tensorflow_serving/example:grpc_client' failed; build aborted.
INFO: Elapsed time: 0.401s
I already ran the ./configure in the tensorflow directory but still I got this error,
Solution was simple for me, I just set the PYTHON_BIN_PATH like so,
export PYTHON_BIN_PATH=/usr/bin/python
Above command ran successfully,
Fri May 19 06:53:21 UTC 2017:cdpdemo:/home/cdpdemo/PythonCode/serving>bazel build //tensorflow_serving/example:grpc_client
WARNING: /home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/tensorflow/workspace.bzl:128:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
WARNING: /home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/tensorflow/contrib/learn/BUILD:15:1: in py_library rule @org_tensorflow//tensorflow/contrib/learn:learn: target '@org_tensorflow//tensorflow/contrib/learn:learn' depends on deprecated target '@org_tensorflow//tensorflow/contrib/session_bundle:exporter': Use SavedModel Builder instead.
WARNING: /home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/external/org_tensorflow/tensorflow/contrib/learn/BUILD:15:1: in py_library rule @org_tensorflow//tensorflow/contrib/learn:learn: target '@org_tensorflow//tensorflow/contrib/learn:learn' depends on deprecated target '@org_tensorflow//tensorflow/contrib/session_bundle:gc': Use SavedModel instead.
INFO: Found 1 target...
Slow read: a 358477128-byte read from /home/cdpdemo/.cache/bazel/_bazel_cdpdemo/9d1d47a9193250486b60cb5a51a8dcb3/execroot/serving/bazel-out/local-fastbuild/bin/external/org_tensorflow/tensorflow/python/_pywrap_tensorflow_internal.so took 7967ms.
Target //tensorflow_serving/example:grpc_client up-to-date:
bazel-bin/tensorflow_serving/example/grpc_client
INFO: Elapsed time: 64.770s, Critical Path: 51.30s
Reference: