環境
Python 3.5.2
OSX 10.10.5
事前準備
condaをインストールする
環境構築
$ conda create py35con python=3.5
$ source activate py35con
※py35conは適当な名前
Tensorflowをインストール
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl
$ pip3 install --upgrade $TF_BINARY_URL
参考サイト:
https://www.tensorflow.org/versions/r0.9/get_started/os_setup.html
出力結果
Collecting tensorflow==0.9.0 from https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl
Using cached https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl
Requirement already up-to-date: six>=1.10.0 in /Users/saicologic/anaconda/envs/py35con/lib/python3.5/site-packages (from tensorflow==0.9.0)
Requirement already up-to-date: wheel>=0.26 in /Users/saicologic/anaconda/envs/py35con/lib/python3.5/site-packages (from tensorflow==0.9.0)
Requirement already up-to-date: numpy>=1.10.1 in /Users/saicologic/anaconda/envs/py35con/lib/python3.5/site-packages (from tensorflow==0.9.0)
Collecting protobuf==3.0.0b2 (from tensorflow==0.9.0)
Using cached protobuf-3.0.0b2-py2.py3-none-any.whl
Requirement already up-to-date: setuptools in /Users/saicologic/anaconda/envs/py35con/lib/python3.5/site-packages/setuptools-25.1.0-py3.5.egg (from protobuf==3.0.0b2->tensorflow==0.9.0)
Installing collected packages: protobuf, tensorflow
Successfully installed protobuf-3.0.0b2 tensorflow-0.9.0
(
動作確認
(py35con)~/Documents/work/keras_demo/keras/examples (master) $ python
REPL
Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>>
トラブルシューティング
Cannot remove entries from nonexistent file /Users/saicologic/anaconda/envs/py35con/lib/python3.5/site-packages/easy-install.pth
解決
$ curl https://bootstrap.pypa.io/ez_setup.py -o - | python
参考サイト:
https://github.com/tensorflow/tensorflow/issues/622
https://github.com/tensorflow/tensorflow/issues/135#issuecomment-174325470