https://github.com/jupyter/notebook/issues/954
用Ctrl+/给Jupyter Notebook注释的时候,注释出现在行首显得代码有点乱。我在上面的链接找到了一个方法。
conda update notebook
conda install jupyter notebook
conda install -c conda-forge jupyter_contrib_nbextensions
conda install -c conda-forge jupyter_nbextensions_configurator
jupyter contrib nbextension install --user jupyter nbextension enable comment-uncomment/main
在MacOS上可能遇到如下错误,改用pip安装即可:
[jupyter_nbextensions_configurator] error loading comment-uncomment/main
conda update notebook conda install jupyter notebook pip install jupyter_contrib_nbextensions jupyter_nbextensions_configurator jupyter contrib nbextension install --user jupyter nbextension enable comment-uncomment/main
# This program prints Hello, world!
print('Hello, world!')