Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Building Tensorflow 1.4.1 from source successful on MacOS, but pip install to Python 2.7.14 of wheel file fails with "not supported wheel on this platform" #15887
See my notes for TensorFlow 1.4.1 install from source below... Note: Bazel build completed successfully, only issue is the failure to "pip install ..." the wheel file.
Describe the problem
< see the tl:dr at bottom of notes...>
Source code / logs
Bazel Build was ok, built for CPU only , 4044 actions, successful completion. Also the build_pip_package works fine. Only issue is the failure to pip install the wheel file
Here are notes of exactly what I did...
TensorFlow Build Notes using Bazel - MCL, Jan. 5, 2018
Done on Macbook, Yosemite 10.10.5, using Xcode-7.2.1
You need to get Xcode7.2.1 from Apple and install it.
For TensorFlow build using Bazel you need to install:
First tried with: Xcode6.3.x (needed to put DOSbox on iPad as DOSpad)
Had to update Xcode. After Xcode7.2.1 install (copy .dmg to /Applications/Xcode7.2.1)
Run it all as root on the Macbook...
Needed to do a "make clean" in Bazel. Do this:
bazel clean --expunge (pitche le vache... totemo, eh?)
Run this to build...
Note: the ./configure is a Q&A. For initial build, no special features were
Once configure is complete, do this... (note, it is all one line...)
The build runs for 66 minutes, and reports:
This makes a build_pip_package.sh file in the ../tensorflow/tools/pip_package subdir.
You now need to make the .whl (the compressed package pip uses to install to python)
Note: "pwd" reports: "/home/TensorFlow/tensorflow-1.4.1
Note: The TensorFlow build instructions use top level directory "/tmp", but I
Note: "bazel-bin" is a directory. You are running the "build_pip_package" script
" ./bazel-bin/tensorflow/tools/pip_package/build_pip_package: No such file or directory"
tensorflow-1.4.1-cp27-cp27m-macosx_10_4_x86_64.whl is not a supported wheel on this platform
What I did:
"tensorflow-1.4.1-cp27-cp27m-macosx_10_4_x86_64.whl is not a supported wheel on this platform"
Result: TensorFlow Build successful, "pip install ..." to Python 2.7.14 on MacOSX
I was expecting the documentation to match this install process.
What I am getting is some very MacOSX version-specific thing being built, which
TL;DR: How can I force the build process to build the "-py2-none-any.whl" type of wheel (which
Solution: Got it to work. Custom-built Tensorflow 1.4.1 installed successfully, via "pip install ... < of the build process_generated wheel file>" . I had booked time to learn in detail how pip packages are built and installed to python, dive deep down another rabbit hole - but the solution here was surprisingly simple. **** Just rename the newly built wheel file! ***.
The above worked fine, no problem. The source-built version of TensorFlow-1.4.1 successfully loaded into the Python 2.7.14 version that I used when I ran the bazel build, which was the one in /usr/local/bin (not the other Python, that I installed from Python site, which is installed into: "/Library/Frameworks/Python.framework/..." directory. As part of the "pip install...", the original tensorflow-1.4.0 version that was installed from binary was successfully removed, all dependencies seemed to be successfully resolved, and the newly-built Tensorflow-1.4.1 was installed. Confirm this by listing your installed packages in Python, with:
So, to be clear: This combo works: MacOS Yosemite 10.10.5, Python 2.7.14 (built from source), Xcode7.2.1 (the last one that can run on Yosemite, downloaded from Apple), Bazel 0.9.0 (latest, requires JDK 8.0. Bazel built from source), Tensorflow-1.4.1 (built from source, using Bazel), and then Python wheel file built using the "build_pip_package" script, in the "bazel-bin/tensorflow/tools/pip_package" directory.
You need to rename the resulting .whl file as indicated above, for the "pip install tensorflow... .whl" final step to work. Ran some test files to confirm TensorFlow operation, and confirmed that for several tests, the source-built Tensorflow-1.4.1 operates, on the MacBook under MacOS, exactly the same as the binary version of Tensorflow-1.4.0, that was previously installed.