jupyter notebook安装插件,代码自动补全

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/yanying1113/article/details/87560002

  1. 首先安装nbextensions,在命令行环境中输入
pip install jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple
jupyter contrib nbextension install --user
  1. 安装nbextensions_configurator,在命令行环境中输入
pip install --user jupyter_nbextensions_configurator 
jupyter nbextensions_configurator enable --user

但是在安装完成之后,重新运行jupiter notebook,并没有出现nbextension插件,报错显示:

[W 21:01:51.399 NotebookApp] 加载插件 jupyter_nbextensions_configurator 失败
   Traceback (most recent call last):
     File "/home/vc/.local/lib/python3.5/site-packages/notebook/notebookapp.py", line 1572, in init_server_extensions
       mod = importlib.import_module(modulename)
     File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
       return _bootstrap._gcd_import(name[level:], package, level)
     File "<frozen importlib._bootstrap>", line 986, in _gcd_import
     File "<frozen importlib._bootstrap>", line 969, in _find_and_load
     File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
   ImportError: No module named 'jupyter_nbextensions_configurator'

使用命令pip list确实已经安装了jupyter-contrib-nbextensionsjupyter-nbextensions-configurator,根据博客 https://blog.csdn.net/Fire_to_cheat_/article/details/84938975 所述,输入命令:

python -m pip install --user jupyter_contrib_nbextensions

重启jupyter notebook,还是没有显示,由于我的笔记本同时装了python2.7和python3.5,所以应该针对python3.5也执行命令:

python3.5 -m pip install --user jupyter_contrib_nbextensions

重新运行jupyter notebook就可以了,这下就可以自动补全了,一下子方便了许多。

展开阅读全文

没有更多推荐了,返回首页