1. Install jupyter_contrib_nbext
Win key + R, enter cmd
Enter the code in this window:
If jupyter_contrib_nbextensions has been installed before, delete it first:
pip uninstall jupyter_contrib_nbextensions
Then install jupyter_contrib_nbextensions:
pip install jupyter_contrib_nbextensions
2. Configure nbextension. Most people will report an error here if they follow the existing tutorials on the Internet.
Online tutorials let us enter:
jupyter contrib nbextension install --user
You will get the following error report:
My solution is:
First check the location of jupyter_contrib_nbextensions, the location is shown in the red circle:
pip show jupyter_contrib_nbextensions
Then open this directory:
Note that you need to replace the "location of jupyter_contrib_nbextensions" in my code with your own, and note that the final file name is "jupyter_contrib_nbextensions" instead of "jupyter-contrib-nbextensions"
cd c:\users\gongjiahao\appdata\roaming\python\python39\site-packages\jupyter_contrib_nbextensions
After opening this directory, enter:
python application.py install
The configuration is completed.
3. Enable the side navigation bar function in notebook
Restart the notebook and notice that we now have an extra function bar:
Click this column with the mouse, first uncheck "disable configuration for nbextensions....", then check "table of contents", and finally re-check "disable configuration for nbextensions...."
Click this button to expand the table of contents: