【工具使用系列】Jupyter(IPython) FAQs,你需要知道的事

来源:互联网 发布:rds 阿里云 编辑:程序博客网 时间:2024/06/05 08:24

安装方式(两种)

针对新用户,使用Anaconda和conda安装Jupyter

  • 下载Anaconda(Python IDE)
    Python3.5版本
    https://repo.continuum.io/archive/Anaconda3-4.2.0-Windows-x86_64.exe
    Python2.7版本
    https://repo.continuum.io/archive/Anaconda2-4.2.0-Windows-x86_64.exe
  • 安装Anaconda
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
    这里写图片描述
  • 安装到此结束,让我们开始玩吧!
    1.点击Jupyter Notebook快捷方式
    这里写图片描述
    这里写图片描述
    这里写图片描述
    2.键入“print “hello world””, 点击“run cell, select below”按钮(或者 shift+enter),输出“hello world”
    这里写图片描述

针对资深玩家,使用Pip进行安装

默认已经安装Python 2.7或者Python 3.5

  • cmd命令行输入cd C:\Python2.x\Scripts或者cd C:\Python3.x\Scripts,其后输入pip install jupyter
    1. 命令输入之前的状态
    这里写图片描述
    1. 命令输入之前的Scripts文件夹目录
    这里写图片描述
    2. 命令输入之后的状态
    这里写图片描述
    2. 命令输入之后的Scripts文件夹目录,出现了ipython应用程序
    这里写图片描述
  • 安装到此结束,让我们开始玩吧!
    cmd命令行输入cd C:\Python2.x\Scripts或者cd C:\Python3.x\Scripts,其后输入ipython notebook
    1.命令输入之前的状态
    这里写图片描述
    1.命令输入之后的状态
    这里写图片描述
    2.浏览器启动,IPython notebook开始运行
    这里写图片描述
    2.IPython notebook开始运行,新建Python2 notebook
    这里写图片描述
    2.Python2 notebook开始运行, 输入框出现
    这里写图片描述
    2.键入“print “hello world””, 点击“run cell, select below”按钮(或者 shift+enter),输出“hello world“
    这里写图片描述

无法通过输入IPython notebook –pylab=inline开启IPython pylab模式?

这里写图片描述

在打开Jupyter(IPython) notebook的情况下,输入%matplotlib inline%matplotlib notebook%pylab inline或者%pylab notebook模式(四选一;仅输入一次)魔术命令;

%matplotlib inline

IPython notebook开始运行后,输入%matplotlib inline魔术命令
这里写图片描述

%matplotlib notebook

IPython notebook开始运行后,输入%matplotlib notebook魔术命令
这里写图片描述

%pylab inline

IPython notebook开始运行后,输入%pylab inline魔术命令
这里写图片描述

%pylab notebook

IPython notebook开始运行后,输入%pylab notebook魔术命令
这里写图片描述

http://jupyter.org/

0 0