其他分享
首页 > 其他分享> > Jupyter Notebook实现代码的自动补全

Jupyter Notebook实现代码的自动补全

作者:互联网

Jupyter Notebook实现代码的自动补全的功能,需要按照以下扩展库:jupyter_contrib_nbextensions和jupyter_nbextensions_configurator。

安装方式:pip install jupyter_XX_XX -i https://XXXXX.XXX.XXX

个人本地之前是安装了Python、Pip、Jupyter等环境,所以此次按照只需要装插件库。

 

总结为四部曲就是:

 

1、pip install jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple

2、jupyter contrib nbextension install

3、pip install jupyter_nbextensions_configurator -i https://pypi.mirrors.ustc.edu.cn/simple

4、jupyter nbextensions_configurator enable

 

这是原来的样子:

下面开始我们的安装!

第一步:安装pip install jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple

 

 

 

第二步:安装另个插件,pip install jupyter_nbextensions_configurator -i https://pypi.mirrors.ustc.edu.cn/simple

 

此时,完成安装后,重启jupyter Notebook,发现报这个错误“Config option template_path*not recognized byLenvsTocHTMLExporter”,如下截图:

 

于是查找原因是因为,

 于是重新指定版本安装了nbconvert,命令如下:conda install "nbconvert=5.6.1"  -i https://pypi.mirrors.ustc.edu.cn/simple

 

 提示安装成功,重启Jupyter Notebook,发现依然没有,发现自己第二步安装完成,没有设置 该插件为 enable状态。执行该命令:jupyter nbextensions_configurator enable --user

 

 重启Jupyter Notebook,则会出现

 

 

 但是发现里面没有内容,发现自己又少做了一步,于是:jupyter contrib nbextension install

 

 此时再重启,jupyter Notebook,插件库中内容都显示了,如下图:

 

最后我们查看下,是否能够自动补全代码,哇,确实OK了。

 最后做个总结,四部曲。不然就会像我一样,每次出现问题又去找原因。

所谓的四部曲就是:

1、pip install jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple

2、jupyter contrib nbextension install

3、pip install jupyter_nbextensions_configurator -i https://pypi.mirrors.ustc.edu.cn/simple

4、jupyter nbextensions_configurator enable

如果出现我以上的配置路径问题,则回退conda install "nbconvert=5.6.1" ,命令见上面。

 

标签:https,jupyter,补全,pypi,Notebook,install,edu,Jupyter,nbextensions
来源: https://www.cnblogs.com/jessicazhangblog/p/15855978.html