在安装tensorflow时显示
no matching distribution found for tensorflow
原因是tensorflow最高支持python3.5,需要在anaconda中将python3.7降版本
学习Conda主要参考官网
https://conda.io/docs/user-guide/getting-started.html
1创建tensorflow环境
conda create -n tensorflow python=3.5
2激活环境
activate tensorflow
3安装tensorflow
pip install tensorflow
4切换环境
5查看当前环境版本
conda list
6使用环境开发
7验证是否安装成功
在命令行窗口输入python进入python环境
import tensorflow as tf
hello = tf.constant(‘Hello, TensorFlow!’)
sess = tf.Session()
print(sess.run(hello))