Windows7下Jupyter Notebook使用入门

目录html

1、Jupyter简介python

2、Jupyter安装json

   2.1 python 3安装浏览器

   2.2 Jupyter 安装服务器

3、Jupyter使用示例markdown

4、Jupyter经常使用命令网络

5、其余说明ide

 

1、Jupyter简介工具

    Jupyter Notebook是一个交互式笔记本,由IPython Notebook演化而来,本质上是一个Web应用程序,经过Jupyter Notebook,你能够使用谷歌浏览器完成python开发工做、交互式演示python代码的执行效果、进行可视化教学等。还能够将整个交互过程转换为pythonhtmlmarkdownPDF等多种格式的文件。也能够经过网络,将python代码及运行效果与朋友共享。网站

 

2、Jupyter Notebook安装

    2.1 python 3的安装(略)

    2.2 Jupyter安装

       python3 -m pip install --upgrade pip  #更新

       python3 -m pip install jupyter    #安装jupyter

       jupyter notebook  #运行notebook

 

3、Jupyter Notebook使用示例

    01-安装jupyter-notebook

01-安装jupyter-notebook.jpg

    02-安装matplotlab

02-安装matplotlab包.jpg

    03-运行jupyter-notebook

03-运行jupyter-notebook.jpg

    04-jupyter-notebook中,画一条sin曲线

04-在jupyter-notebook中,画一条sin曲线.jpg

    05-直接访问本地8888端口,须要输入密码或token

05-直接访问本地8888端口,须要输入密码或token.jpg

    06-token的获取方式-jupyter notebook list

06-token的获取方式-jupyter notebook list.png

    07-运行Python,使用passwd,生成sha1密码

07-运行Python,使用passwd,生成sha1密码.jpg

    08-修改过jupyter notebook配置文件后,重启服务

08-修改过jupyter notebook配置文件后,重启服务.png

    09-正常转化为PDF须要安装Windows版本的Miktex,而且要设置好路径,安装扩展包

    09-正常转化为PDF须要安装Windows版本的Miktex,而且要设置好路径,安装扩展包.png


4、Jupyter经常使用命令

jupyter --help  #查看jupyter帮助

jupyter notebook help  #查看notebook详细的命令使用帮助

jupyter notebook #使用默认配置启动notebook

jupyter notebook --generate-config #c:/Users/用户/.jupyter/目录下,建立默认配置文件jupyter_notebook_config.py

jupyter notebook list  #查看正在运行的jupyter服务器地址、token令牌、根目录

jupyter notebook password  #修改notebook登陆密码

jupyter nbconvert file1.ipynb --to pdf  #手工转换ipynb文件为PDF文件

jupyter nbconvert file1.ipynb --to html  #手工转换ipynb文件为html文件

 

5、其余说明

5.1 jupyter 除了jupyter notebook子命令之外,还有好多子命令,好比jupyter nbconvert / jupyter console 等,可用经过jupyter --help查看。

5.2 若是直接运行jupyter notebook 命令,系统会自动建立一个48位的token,并使用默认配置启动notebook,用户能够经过http://localhost:8888/?token=<48token >网址访问notebook,每次退出并重启notebook 服务端,系统会自动从新生成token

5.3 能够在运行jupyter notebookcmd控制台中,获取token信息,当经过网络访问jupyter notebook时,输入该token,可登陆jupyter notebook

5.4 也能够使用jupyter notebook password 命令,建立一个访问密码,建立密码之后,token方式会失效,只能够使用密码方式访问。同时会生成一个哈希密码文件,路径为C:/Users/用户/.jupyter/jupyter_notebook_config.json。重启jupyter notebook服务端,密码才生效。

5.5直接运行jupyter notebook命令,只能在本机访问notebook。咱们还能够带IPPort参数启动notebook,例:jupyter notebook --ip=192.168.1.123 --port=6789 ,能够经过http://192.168.1.123:6789地址,在其余电脑上访问notebook

5.6 若是使用jupyter notebook --generate-config命令生成默认配置文件jupyter_notebook_config.py,咱们也能够把IPport等信息写入到该配置文件中,直接启动jupyter notebook时,会读取配置文件的内容。变量以下,

c.NotebookApp.ip = '192.168.1.123'

c.NotebookApp.port = 6789

5.7 直接将ipynb文件转换为htmlpy文件是没有问题的,要转换为pdf文件会报错,须要到https://miktex.org/download,下载安装Miktexbasic-miktex-2.9.7021-x64.exe),并将C:\Program Files\MiKTeX 2.9\miktex\bin\x64路径加入到系统Path路径中。能够使用命令行方式转换:jupyter nbconvert test.ipynb --to pdf ,也能够直接在notebook网站中打开test.ipynb文件,直接导出PDF文件。

 

 

参考连接:

Jupyter官网

https://jupyter.org/

https://jupyter-notebook.readthedocs.io/en/stable/

 

Jupyter Notebook介绍与入门

https://blog.csdn.net/ibelieveican2015/article/details/79024927

 

jupyter-使用及设置密码

https://www.jianshu.com/p/b1189769aeb2

 

Windows下的Jupyter Notebook 安装与自定义启动(图文详解)

http://www.cnblogs.com/zlslch/p/6984403.html

 

为何Jupyter Notebook会比其余工具更受欢迎?

http://m.elecfans.com/article/687743.html

 

jupyter安装,修改登陆密码,启动

https://blog.csdn.net/hotpotbo/article/details/79130899

相关文章
相关标签/搜索