Tensorflow安装和jupyter notebook配置

Anaconda虚拟环境下安装tensorflow

查看已有虚拟环境:conda env list

  • 创建环境 conda create --name tensorflow2.0 python==3.7
    – 激活环境:active tensorflow2.0 退出环境:deactivate tensorflow2.0
  • 安装相关软件包
    pip install numpy matplotlib Pillow scikit-learn pandas -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 安装tensorflow
    pip --default-timeout=100 install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 测试安装是否成功
    打开python交互模式 import tensorflow

如果当前虚拟环境没有jupyter notebook,会调用base环境下的j.

虚拟环境下安装jupyter notebook及其初始配置。

  • conda install ipython
  • conda install jupyter

更改jupyter notebook的默认文件打开位置 :

  1. jupyter notebook --generate-config,会生成对应的配置文件,在配置文件.py里修改属性 c.NotebookApp.notebook_dir = ’ ’ ,在引号里写想要打开的位置 。
  2. 在快捷打开方式里把属性目标里的%HOMEPATH%删掉。(友情提示文件属性目标有文字限制 大概在270字个左右,所以起虚拟环境名字的时候要写短一点)

jupyter notebook可以安装插件 安装Nbextensions插件,可在jupyter notebook的终端页面输入
pip install jupyter_contrib_nbextensions

如果jupyter notebook没有tab键补全的功能,可以尝试将jedi版本从0.18.0降至0.17.2。

  • pip install jedi==0.17.2
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值