问题描述
如果用jupyter notebook跑代码时,当分了很多点,想看到对应的目录,对总体有个概览时,会发现notebook木有自动生成目录的栏目。
解决方法
(1)下载插件:
pip install jupyter_contrib_nbextensions
(2)重启打开jupyter,可以发现多了一栏Nbextensions
。
(3)如果发现栏Nbextensions
的插件很少,那可能要重新下载再启动:
# 1、先卸载扩展包
pip uninstall jupyter_contrib_nbextensions
pip uninstall jupyter_nbextensions_configurator
# 2、再安装Nbextensions
pip install jupyter_contrib_nbextensions
# 3、安装 javascript and css files
jupyter contrib nbextension install --user
# 4、安装configurator
(4)勾选Table of Contents (有的版本是toc2)。jupyter notebook就有目录啦。
Reference
(1)https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html