anacoda 安装tensorflow

python2

沙盒环境下安装

利用Anacoda安装了一个沙盒环境,环境名字就叫tensorflow
conda create -n tensorflow python=2.7

激活环境,注意以后每次使用tensorflow时都需要激活
source activate tensorflow

在沙盒环境中,使用 conda 安装 TensorFlow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py2-none-any.whl

结束tensorflow运行时需要关闭环境
source deactivate

可能出现的问题及解决方法
  • 通过如下命令获得现有的notebook路径及名称
    ipython kernelspec install-self --user #old_kernel_path_and_name

  • 为新笔记本建立路径
    mkdir -p ~/.ipython/kernels/

  • 保存新笔记本的路径
    mv old_kernel_path_and_name /.ipython/kernels/

  • 更名新笔记本为tfkernel,将下面路径中的kernel.json文件中的python2换成tfkernel即可
    cd ~/.ipython/kernels/tfkernel

最后在沙盒环境中执行 jupter notebook ,新建一个kernel时便可以看到tfkernel了

python3

  • 重新安装了python3的沙盒环境
    conda create --name python36 python=3.6

  • 激活新建的python3环境
    source activate python36

  • 新建py3下的jupyter notebook
    ipython kernel install --user --name=python3

  • 查看现在jupyter kernel的版本,有python3的就好了
    jupyter kernelspec list

  • 激活tensorflow环境
    source activate tensorflow

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值