Windows环境下在jupyter中安装tensorflow

1下载安装anaconda

首先,我们在anaconda官网上下载anaconda,具体的下载安装过程不再细说,在windows终端使用conda --version来验证是否安装成功:

C:\Users\hp>conda --version
conda 4.3.30

接下来使用jupyter notebook进入jupyter环境:

C:\Users\hp>jupyter notebook
[I 09:34:32.864 NotebookApp] JupyterLab alpha preview extension loaded from C:\Users\hp\Anaconda3\lib\site-packages\jupyterlab
JupyterLab v0.27.0
Known labextensions:
[I 09:34:32.864 NotebookApp] Running the core application with no additional extensions or settings
[I 09:34:33.400 NotebookApp] Serving notebooks from local directory: C:\Users\hp
[I 09:34:33.400 NotebookApp] 0 active kernels
[I 09:34:33.400 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 09:34:33.400 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

在浏览器中输入http://localhost:8888/即可进入jupyter的开发环境。

2.配置tensorflow环境

在终端输入conda create -n tensorflow python=3.5,即可创建python版本为3.5的tensorflow环境,并使用activate tensorflow进行tensorflow环境:

C:\Users\hp>activate tensorflow

(tensorflow) C:\Users\hp>

并输入pip install tensorflow进行tensorflow的安装,鉴于安装时间过慢(且很大概率安装不成功),这里推荐使用清华的镜像进行下载:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

接下来分别使用conda install jupyter;conda install ipython;conda install spyder,在tensorflow环境中进行jupyter、ipython以及spyder的安装:

(tensorflow) C:\Users\hp>conda install jupyter
(tensorflow) C:\Users\hp>conda install ipython
(tensorflow) C:\Users\hp>conda install spyder

3.在tensorflow环境中进入jupyter

安装完成后退出windows终端,然后重新进入windows终端,使用activate tensorflow进入所创建的tensorflow环境,在tensorflow环境中输入jupyter notebook,即可进入可使用tensorflow的jupyter环境,每次进入jupyter环境的时候,重复这一段操作即可:(同理,可进入tensorflow环境下的ipython以及spyder)

C:\Users\hp>activate tensorflow

(tensorflow) C:\Users\hp>jupyter notebook
[I 10:02:49.472 NotebookApp] Serving notebooks from local directory: C:\Users\hp
[I 10:02:49.472 NotebookApp] 0 active kernels
[I 10:02:49.472 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 10:02:49.472 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
#在jupyter中输入这段代码,运行成功则说明安装成功
import tensorflow as tf
print(tf.__version__)
1.6.0

 

 

 

  • 5
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值