目录

一、Jupyter简介

二、Jupyter安装

2.1 python 3安装

2.2 Jupyter 安装

三、Jupyter使用示例

四、Jupyter常用命令

五、其他说明

一、Jupyter简介

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

二、Jupyter Notebook安装

2.1 python 3的安装(略)

2.2 Jupyter安装

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

python3 -m pip install jupyter #安装jupyter

jupyter notebook #运行notebook

三、Jupyter Notebook使用示例

01-安装jupyter-notebook

02-安装matplotlab包

03-运行jupyter-notebook

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

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

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

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

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

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

四、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.1 jupyter 除了jupyter notebook子命令以外,还有好多子命令,比如jupyter nbconvert / jupyter console 等,可用通过jupyter --help查看。

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

5.3 可以在运行jupyter notebook的cmd控制台中,获取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。我们还可以带IP和Port参数启动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,我们也可以把IP、port等信息写入到该配置文件中,直接启动jupyter notebook时,会读取配置文件的内容。变量如下,

c.NotebookApp.ip = '192.168.1.123'

c.NotebookApp.port = 6789

5.7 直接将ipynb文件转换为html和py文件是没有问题的,要转换为pdf文件会报错,需要到https://miktex.org/download,下载安装Miktex(basic-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

更多相关文章

  1. 在Python中的大文件中拆分行的内存问题
  2. RobotFramework中加载自定义python包中的library(一个py文件中有
  3. Python文件遍历的三种方法
  4. python 的基础学习 第九天 文件的操作
  5. Python3.6中PyInstaller不能对文件进行打包问题
  6. 读取python中的unicode文件,该文件以与python源代码相同的方式声
  7. python 操作excel 读写同一个文件
  8. Python csv。读者:我如何返回到文件的顶部?
  9. 使用自定义qemu二进制文件与libvirt失败?

随机推荐

  1. link标签和script标签跑到body下面,网页顶
  2. HTML高级标签之窗口分帧(前台界面演示)
  3. easyui-tree根据叶子节点获取父节点值(N
  4. HTML中的attribute和property的区别
  5. 夜灵的Html笔记Day04——CSS3basic
  6. 网页局部打印
  7. Html5的datetime-local控件
  8. 缓存js / css资源以使我的项目脱机工作
  9. 使用html5中的base64数据播放音频。
  10. 如何在CSS中添加旋转图像?