1

I am following https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/graph_transforms/README.md#optimizing-for-deployment and running this command:

bazel build tensorflow/tools/graph_transforms:transform_graph

and getting this error:

ERROR: /Users/daniel/software/tensorflow/tensorflow/core/BUILD:2475:1: no such package '@local_config_git//': Traceback (most recent call last): File "/Users/daniel/software/tensorflow/third_party/git/git_configure.bzl", line 52 _fail(result.stderr) File "/Users/daniel/software/tensorflow/third_party/git/git_configure.bzl", line 14, in _fail fail(("%sGit Configuration Error:%s %...))) Git Configuration Error: java.io.IOException: Cannot run program "/usr/bin/python3" (in directory "/private/var/tmp/_bazel_daniel/bff3ff07c5339b6b7496cc244d119e78/external/local_config_git"): error=2, No such file or directory and referenced by '//tensorflow/core:version_info_gen' ERROR: /Users/daniel/software/tensorflow/tensorflow/core/BUILD:2475:1: no such package '@local_config_git//': Traceback (most recent call last): File "/Users/daniel/software/tensorflow/third_party/git/git_configure.bzl", line 52 _fail(result.stderr) File "/Users/daniel/software/tensorflow/third_party/git/git_configure.bzl", line 14, in _fail fail(("%sGit Configuration Error:%s %...))) Git Configuration Error: java.io.IOException: Cannot run program "/usr/bin/python3" (in directory "/private/var/tmp/_bazel_daniel/bff3ff07c5339b6b7496cc244d119e78/external/local_config_git"): error=2, No such file or directory and referenced by '//tensorflow/core:version_info_gen' ERROR: /Users/daniel/software/tensorflow/tensorflow/core/BUILD:2475:1: no such package '@local_config_git//': Traceback (most recent call last): File "/Users/daniel/software/tensorflow/third_party/git/git_configure.bzl", line 52 _fail(result.stderr) File "/Users/daniel/software/tensorflow/third_party/git/git_configure.bzl", line 14, in _fail fail(("%sGit Configuration Error:%s %...))) Git Configuration Error: java.io.IOException: Cannot run program "/usr/bin/python3" (in directory "/private/var/tmp/_bazel_daniel/bff3ff07c5339b6b7496cc244d119e78/external/local_config_git"): error=2, No such file or directory and referenced by '//tensorflow/core:version_info_gen' ERROR: Analysis of target '//tensorflow/tools/graph_transforms:summarize_graph' failed; build aborted: no such package '@local_config_git//': Traceback (most recent call last): File "/Users/daniel/software/tensorflow/third_party/git/git_configure.bzl", line 52 _fail(result.stderr) File "/Users/daniel/software/tensorflow/third_party/git/git_configure.bzl", line 14, in _fail fail(("%sGit Configuration Error:%s %...))) Git Configuration Error: java.io.IOException: Cannot run program "/usr/bin/python3" (in directory "/private/var/tmp/_bazel_daniel/bff3ff07c5339b6b7496cc244d119e78/external/local_config_git"): error=2, No such file or directory ```

The recurring line of interest (I think) is java.io.IOException: Cannot run program "/usr/bin/python3". The error message is correct:

$ ls /usr/bin/python3 ls: /usr/bin/python3: No such file or directory

But I'm not sure why it's looking for /usr/bin/python3 in the first place, as it's not in my PATH:

$ type python3 python3 is /anaconda3/bin/python3

Is bazel hardcoded to look for that path? I can't create anything in /usr/bin, see: Install Python 3 to /usr/bin/ on macOS

I don't really know what to do here. Any advice welcome.

kit
  • 1,166
  • 5
  • 16
  • 23

1 Answers1

1

[UPDATE] -- Running ./configure from tensorflow/ and accepting all the default options fixed my problem.