python - 安装 jupyter notebook 扩展

标签 python ipython-notebook jupyter-notebook jupyter ipython-magic

我尝试在 jupyter notebook 上安装一些扩展,但没有成功,而且不知道该怎么做。 所以基本上我想在我的笔记本中检查 pep8 代码。 我检查了这篇文章: Verifying PEP8 in iPython notebook code

但是 %install_ext 已被弃用,所以我使用了

jupyter nbextension install https://raw.githubusercontent.com/SiggyF/notebooks/master/pep8_magic.py --user

所以我得到:

Copying: /tmp/tmpw74yl7m2/pep8_magic.py -> /home/louis/.local/share/jupyter/nbextensions/pep8_magic.py

To initialize this nbextension in the browser every time the notebook (or other app) loads:

          jupyter nbextension enable <the entry point> --user

从现在开始我无法让它工作。 我试过:

~$ jupyter nbextension enable pep8_magic.py --user
Enabling notebook extension pep8_magic.py...
      - Validating: problems found:
        - require?  X pep8_magic.py

没有成功。

谁能解释一个简单的方法让它工作以及我错过了关于 jupyter 扩展的什么?

谢谢!

最佳答案

我从链接中手动复制文件,然后添加到/.ipython/extensions(或/nbextensions)并加载到笔记本中:%load_ext pep8_magic

目前正在测试,但我觉得还不错

关于python - 安装 jupyter notebook 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41587753/

相关文章:

python - mysql 连接与 python 中的并发.futures 不能很好地配合

linux - 我如何在 anaconda python 中导入 OpenGL?

python - 不显示缺失值​matplotlib

python - Pandas :从列 A 中提取 B 列不存在的数据

python - Python Google Drive API 出现 SSL 错误

python - PyQt:动态添加qpushbutton

python - 应用引擎/ python : Why isn't the exception caught?

google-compute-engine - 错误 : Unauthorized on my own Google Cloud notebook

ipython notebook 在单元格之间导航

jupyter-notebook - 在 Jupyter 中安装 xeus-cling 后,C++14 不可见(Ubuntu 18.04 - Anaconda)