1 安装要求
TensorFlow 安装的前提是系统安装了 Python 2.5 或更高版本
为了安装 TensorFlow,首先确保你已经安装了 Anaconda
了解安装的python版本 python --version
2 创建镜像
为了安装快速,可以不执行此步也能成功安装,只是速度慢一些
用以下两行代码用来改成连接清华镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes
3 创建环境
在命令行中使用以下命令创建 conda 环境:
conda create -n tensorflow python=3.7.3(python的版本,我的是3.7.3)
出现提示的时候输入y就可以成功创建环境
4 激活环境
命令行输入:
Conda activate tensorflow
激活环境
5 安装tensorflow
直接在命令行输入:
pip install tensorflow
安装程序
安装完成后进入python测试,如下程序执行成功,说明成功安装