1 $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
1 $ brew install bazel
You are all set. You can confirm Bazel is installed successfully by running bazel version.html
1 $ git clone https://github.com/tensorflow/tensorflow
1 $ cd tensorflow
進入這個文件夾,而後輸入:java
1 $ ./configure
進行配置,在配置過程當中會出現一系列的問題,一般狀況下沒有特殊的要求,通常所有都選擇n:python
1 $ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
1 $ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
1 $ sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp27-cp27m-macosx_10_7_x86_64.whl
至此就完成了。git
>>> import tensorflow as tf Traceback (most recent call last): File "<stdin>", line 1, in <module> File "tensorflow/__init__.py", line 24, in <module> from tensorflow.python import * File "tensorflow/python/__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "tensorflow/python/pywrap_tensorflow.py", line 52, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "tensorflow/python/pywrap_tensorflow.py", line 41, in <module> from tensorflow.python.pywrap_tensorflow_internal import * ImportError: No module named pywrap_tensorflow_internal Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.