安装前,首先翻墙,谷歌的东西,你懂得。。。。
1.安装anacanda
anacanda的好处就不用说了,集成了很多package,省得一一下载。
1.mac 去官网下载就好了
https://www.continuum.io/downloads
2.linux的ubuntu,和mac都是自带python2.7。假如你需要python3版本的,下载anacanda3。进入目录,执行sh文件。
安装好后,接下来mac和ubuntu操作一样。查看python版本
我直接输入python是因为把python3的环境变量改了。直接指向python3了。
输入conda
让我们list下看看都有什么包。输入conda list
2.激活tensorflow环境
输入conda create -n tensorflow python=3.6
输入source activate tensorflow
可以看到前面括号里带上了(tensorfolw)
3.安装tensorflow
1.python2的各个版本
# Ubuntu/Linux 64-bit, CPU only, Python 2.7:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7. Requires CUDA toolkit 7.5 and CuDNN v4.
# For other versions, see "Install from sources" below.
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
# Mac OS X, CPU only:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py2-none-any.whl
2.python3的各个版本
# Ubuntu/Linux 64-bit, CPU only, Python 3.4:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl
# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4. Requires CUDA toolkit 7.5 and CuDNN v4.
# For other versions, see "Install from sources" below.
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl
# Mac OS X, CPU only:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py3-none-any.whl