【Python】基于JupyterLab,Jupyter Notebook 7大版本更新!

共 2929字,需浏览 6分钟

 ·

2023-08-20 13:12





本文分享Jupyter Notebook大版本v7.0.0更新亮点+简单测试!

近日,Jupyter Notebook大版本v7.0.0更新,Jupyter Notebook v7.0.0基于JupyterLab,因此它包含了过去几年JupyterLab中添加的许多新功能和改进, 部分 亮点更新包括:

  • 主题和深色模式 (theming and dark mode)

  • 交互式调试 (interactive debugging)

  • 实时协作 (real-time collaboration)

  • 界面语言更换 (internationalization)

  • JupyterLab扩展支持 (Support for many JupyterLab extensions)

  • 移动设备支持 (compact view on mobile devices)

  • 目录索引 (table of contents)




Jupyter Notebook 7.0.0体验



  • 光速安装


pythonic生物人温馨提示:变化有点大,升级需谨慎!


      
# 升级方法
pip install notebook --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple


48cd2b94614463441d99ed42ce1a50aa.webp安装成功了!



  • 简单体验


体验一下,efe7c1ac6a55058768eb4986498091cd.webp68eee66510f10622ada15b3708646215.webp49dc6e12a9d31191ab718d37525ac41e.webpa1ff46a6d165f8f6eed261fe827dd3ae.webp


感觉变化有些大,总体YYDS!




以下简单测试从Jupyter Notebook version 6 升级到version 7 时新增的部分内容:


主题和深色模式 (theming and dark mode)


Jupyter Notebook默认的是白色主题,现在Jupyter Notebook 7默认支持护眼深色主题:70aff47e6db702c2cb424b5cb7524266.webp


也可以使用JupyterLab的主题,如pip install jupyterlab-night安装JupyterLab的浅色主题。


其它主题,如Nord主题,3ff6572215590943b4d5a079bb406257.webp


如Mexico主题,db40262782bb5dfbd03e907db0a991ca.webp




交互式调试 (interactive debugging)


Jupyter Notebook 7新增了来自JupyterLab的交互式调试器 (interactive debugger),它使您能够逐个代码单元格地执行代码,也可以设置断点并检查变量。


e195457c62d9c55a28cf43edde36cc14.webp


实时协作 (real-time collaboration)


您可以与其他用户共享您的notebook并实时操作他,甚至适用于JupyterLab和Jupyter Notebook之间实时协作。


pip install jupyter-collaboration 即可开始实时写作。


2adf6a1173f5f6b4ac72328f25e25205.webp


界面语言更换 (internationalization)


Jupyter Notebook 7现在提供了设置用户界面显示语言的功能,需要安装Python语言包,例如,可以使用pip install jupyterlab-language-pack-zh-CN命令安装中文语言包:427335cade28411e2b9fc0057d19d3b6.webp


更多语言支持:https://github.com/jupyterlab/language-packs/tree/main




JupyterLab扩展支持 (Support for many JupyterLab extensions)


Jupyter Notebook 7是基于JupyterLab的,因此支持许多现有的JupyterLab扩展。


您可以使用pip或conda安装JupyterLab扩展。例如,要安装LSP(Language Server Protocol)扩展以获得增强的代码补全功能,您可以使用以下命令:


      
# pip安装
pip install jupyter-lsp


# 或者conda安装
conda install -c conda-forge jupyter-lsp


其它像JupyterLab中nbgrader和RISE这样的流行扩展已经被移植到适用于Jupyter Notebook 7的版本。 d9390c975d9938258a290047e6d16bce.webp




移动设备支持 (compact view on mobile devices)


Jupyter Notebook 7会自动在移动设备上切换到更紧凑的布局,使得在移动时运行代码更加方便。 


1eb5d080e4c821551419750f8636f4f8.webp




目录索引 (table of contents)


Jupyter Notebook 7新增目录索引,它允许您使用侧边栏导航浏览notebook内容,目录索引默认启用,就像在JupyterLab中一样。b0a8df182a9934a3633553918c55394b.webp


进一步学习:



  • https://github.com/jupyter/notebook

  • https://jupyter-notebook.readthedocs.io/en/latest/changelog.html

  • https://jupyter-notebook.readthedocs.io/en/latest/notebook_7_features.html#support-for-many-jupyterlab-extensions


    

-END-


          

                

                  

                    

                      

                            
往期
精彩
回顾







浏览 168
点赞
评论
收藏
分享

手机扫一扫分享

分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

分享
举报