Python学习日记2 安装tensorflow

在安装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))

猜你喜欢

转载自blog.csdn.net/weixin_43387285/article/details/83021291