如何使用带note8扩展的autoepython

2024-06-26 14:23:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我是python扩展的新手,在安装autoep8并运行以下命令之后:

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

它返回:

^{pr2}$

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


Tags: 代码命令masterenablejupyter按钮nbextensionipynb
1条回答
网友
1楼 · 发布于 2024-06-26 14:23:07

验证是否已安装autoep8,并从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

相关问题 更多 >