1

我是 python 扩展的新手,在安装 autopep8 并运行后:

jupyter nbextension enable jupyter-autopep8-master/jupyter-autopep8

它返回:

Enabling notebook extension jupyter-autopep8-master/jupyter-autopep8...
      - Validating: problems found:
        - require?  X jupyter-autopep8-master/jupyter-autopep8

但是我在 ipynb 界面上没有看到任何用于将代码自动格式化为 pep8 的新按钮。如何在 ipynb 中使用扩展?谢谢。

4

1 回答 1

1

验证是否安装了 autopep8 并从 repo 安装扩展:

pip install autopep8
sudo jupyter nbextension install https://github.com/kenkoooo/jupyter-autopep8/archive/master.zip --user
sudo jupyter nbextension enable jupyter-autopep8-master/jupyter-autopep8
sudo jupyter nbextension list

根据您的 Jupyter 设置,您可能需要重新启动 Jupyter 服务:

sudo service jupyter restart

于 2019-06-19T22:07:46.230 回答