win10+Anaconda+Tensorflow安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Forlogen/article/details/82844338
  1. 安装适合你系统的annaconda,注意操作系统的位数即可,安装很简单。因为anaconda自带了python的环境,所以不必单独安装python,只需要这样:
    在这里插入图片描述

  2. 测试Anaconda是否安装成功:打开菜单目录下的Anaconda Prompt,输入conda list,如果能输出如下信息,表示安装成功,你也可以看到anaconda自动安装了哪些库。
    在这里插入图片描述

  3. 开始安装tensorflow:因为tensorflow是国外的东西,所以你懂的!这里我们使用清华的仓库镜像,加快速度,逐条输入下面的命令:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
conda config --set show_channel_urls yes 

在这里插入图片描述

  1. 建一个python3.5的环境,环境名称为tensorflow ,输入下面命令:
conda create -n tensorflow python=3.5

在这里插入图片描述
在这里插入图片描述

  1. 在Anaconda Prompt中启动tensorflow环境(当不使用tensorflow时,关闭tensorflow环境,命令为:conda deactivate ):
activate tensorflow

在这里插入图片描述

  1. 安装cpu版本的TensorFlow ,输入以下命令,接着耐心等待安装成功!
pip install --upgrade --ignore-installed tensorflow
或
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow  

在这里插入图片描述
在这里插入图片描述

  1. 测试tensorflow是否安装成功:在Anaconda Prompt中启动tensorflow环境,并进入python环境,输入如下测试代码:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!') 
sess = tf.Session() 
print (sess.run(hello)) 

在这里插入图片描述
在这里插入图片描述

  1. 在Anaconda navigator进入tensorflow环境中安装ipython、spyder和jupyter notebook,以及其他你需要的部分直接点击图标的Install或者在Environment中选择Not Install搜索ipy和spy,安装就好。
    在这里插入图片描述

  2. 安装后可能会出现spyder一直卡在Connecting the Kernel的问题。
    在这里插入图片描述

我也不知道怎么解决,查了好多方法也么用。。。。。重装就好了,哭死!!!有解决的人可以留个言,造福大众。
祝所有安装的人一次性成功 阿弥陀佛。

猜你喜欢

转载自blog.csdn.net/Forlogen/article/details/82844338