tensorflow: Failed to build on Mac OSX: "Could not find python binary"
I am trying to compile tensorflow from source but cannot build master. The build for the pip package fails with the following error message
ERROR: /Users/till/git/tensorflow/tensorflow/tensorboard/components/vz_sorting/BUILD:8:1: Compiling 2 TypeScript files failed: execrooter failed: error executing command
(cd /private/var/tmp/_bazel_till/3e885964b28c274cf7e8652af4ed1911/execroot/tensorflow && \
exec env - \
bazel-out/host/bin/tensorflow/tensorboard/scripts/execrooter bazel-out/local-py3-opt/bin/tensorflow/tensorboard/components/vz_sorting/vz_sorting-tsc-execroot.json): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Traceback (most recent call last):
File "bazel-out/host/bin/tensorflow/tensorboard/scripts/execrooter", line 168, in <module>
Main()
File "bazel-out/host/bin/tensorflow/tensorboard/scripts/execrooter", line 148, in Main
raise AssertionError('Could not find python binary: ' + PYTHON_BINARY)
AssertionError: Could not find python binary: python3
I am running Mac OSX 10.12.4, bazel 0.4.5, python 3.6.1 in a conda virtual environment, Apple LLVM version 8.1.0 (clang-802.0.42). This might be related to https://github.com/bazelbuild/bazel/issues/2752.
Any suggestions would be greatly appreciated.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 20 (13 by maintainers)
@justprotato
To test out bazel, you need to compile it. To compile a development version of Bazel, you need the latest released version of bazel, which can be compiled from source.
bazel build //src:bazel builds the Bazel binary using bazel from your PATH and the resulting binary can be found at bazel-bin/src/bazel. This is the recommended way of rebuilding Bazel once you have bootstrapped it.
Install a release version of Bazel
git clone the master branch of Bazel then checkout HEAD (https://github.com/bazelbuild/bazel/issues/2140)
Run:
bazel build //src:bazelin the directory where you have the master branch files.The output files are in the src folder inside the bazel-bin folder.
Replace your bazel file (example: /usr/local/bin/bazel) with the one in the bazel-bin/src folder.
Then to install TensorFlow
Build the pip package (https://www.tensorflow.org/install/install_sources)
From the root of the TensorFlow directory run: ‘./tensorflow/tools/pip_package/build_pip_package.sh /tmp/tensorflow_pkg’
Run: ‘pip install /tmp/tensorflow_pkg/tensorflow-1.2.0rc2-cp36-cp36m-linux_x86_64.whl’
I’m quite sure this is related to https://github.com/bazelbuild/bazel/issues/2752. Until that fix percolates through the releases: I got the build to move on without tensorboard by deleting line https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/BUILD#L162, i. e.
"//tensorflow/tensorboard",I also tried changing the 239 occurrences of
PYTHON_?(BIN)(ARY)?_?(PATH)? ?=in 132 files, plus the other 196 occurrences in 108 files in/tmp/_bazel/, but bazel apparently checks hashes for the files it generates.