Jupyter Notebook代码补全Error executing Jupyter command 'contrib': [Errno 'jupyter-contrib' not found] 2
安装过程:
进入命令行环境(cmd)
1.安装nbextensions
pip install --user jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple
jupyter contrib nbextension install --user
2.安装nbextensions_configurator
pip install --user jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
安装完成后,启动Jupyter notebook,可以看见标签页多了一个Nbextensions标签
进入Nbextensions标签页面,该页面即为Jupyter的插件中心。勾选Hinterland即打开了自动补全功能,接下来打开一个notebook体验一下吧。
这是网上通用的安装方法,其中的--user 有的有,有的没有,不知道什么意思。
安装遇到的问题(错误):
Error executing Jupyter command 'contrib': [Errno 'jupyter-contrib' not found] 2
在运行完第一句语句后并显示成功安装后输入jupyter contrib nbextension install --user就出现了问题,意思就是这条命令没有找到,网上找了大半天,发现许多人也在问这个问题,通过不断的查找,最后的原因我认为是归结于pip和conda命令的对于依赖的区别,下面这句是在Stack Overflow的回答:
Pip installs from PyPI. There are no releases of the basemap package on PyPI, it is just a simple registration page pointing at the real download location (SourceForge).
Conda pulls from its own repository, typically with convenience builds of libraries common to the community Conda is aimed at. Conda's repository has a version of the basemap package available for installation, so it succeeds.
意思就是conda会把相应的依赖装上去,看了许多人的反馈,发现有时候pip install XXX安装不成功但是conda install XXX却成功了
如果是anaconda,可以使用命令:
conda install -c conda-forge jupyter_contrib_nbextensions
推荐阅读
-
Error executing Jupyter command ‘notebook‘: [Errno 2] No such file or directory
-
jupyter notebook - Error executing Jupyter command 'notebook': [Errno 2] No such file or directory
-
Error executing Jupyter command 'notebook': [Errno 'jupyter-notebook' not found] 2
-
Error executing Jupyter command 'notebook': [Errno 2 解决方案
-
Error executing Jupyter command 'notebok': [Errno 'jupyter-notebok' not found] 2
-
由jupter notebook:Error executing Jupyter command ‘notebook‘: [Errno ‘jupyter-notebook‘ not found]的思考
-
[已解决]Error executing Jupyter command 'notebook': [Errno 'jupyter-notebook' not found] 2
-
Error executing Jupyter command 'contrib': [Errno 'jupyter-contrib' not found]解决办法
-
Jupyter Notebook代码补全Error executing Jupyter command 'contrib': [Errno 'jupyter-contrib' not found] 2