python3.6(官方文档Windows目前只能下python3.5或3.6的版本):
pip升级(官方要求pip版本大于19):
python -m pip install --upgrade pip
cmd一行命令即可:
pip install -i https://pypi.doubanio.com/simple/ tensorflow_cpu
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow_cpu
安装成功!
中间 https://pypi.doubanio.com/simple/ 是豆瓣镜像
pip默认国外下载,网速极慢
故可更换为国内镜像:
阿里云: http://mirrors.aliyun.com/pypi/simple/
中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban): http://pypi.douban.com/simple/
清华大学: https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学: http://pypi.mirrors.ustc.edu.cn/simple/
测试:
命令行:python
接着输入:
import tensorflow as tf
a = tf.constant(10)
b = tf.constant(32)
c = a+b
print(c)
输出:
测试成功!