我正在尝试将 nbextensions 安装到我的 jupyter 笔记本上。打开笔记本时,我可以看到 nbextensions 的选项卡,但它是空的。有一个重新加载按钮在移动,但没有任何显示。我转到命令提示符并成功执行了以下命令:
pip install jupyter_contrib_nbextensions
pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master
conda install -c conda-forge jupyter_contrib_nbextensions
但是当我尝试执行
jupyter contrib nbextension install --user
似乎所有扩展都有效,但是在编写它们时会出现大量错误。
[I 09:49:34 InstallContribNbextensionsApp] - Validating: ok
[I 09:49:34 InstallContribNbextensionsApp] Installing jupyter_contrib_nbextensions items to config in C:\Users\sammy\.jupyter
Enabling: jupyter_nbextensions_configurator
- Writing config: C:\Users\sammy\.jupyter
- Validating...
jupyter_nbextensions_configurator ok
Enabling notebook nbextension nbextensions_configurator/config_menu/main...
Traceback (most recent call last):
File "C:\Users\sammy\Anaconda3\Scripts\jupyter-contrib-script.py", line 5, in <module>
sys.exit(jupyter_contrib_core.application.main())
File "C:\Users\sammy\Anaconda3\lib\site-packages\jupyter_core\application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\Users\sammy\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
app.start()
File "C:\Users\sammy\Anaconda3\lib\site-packages\jupyter_contrib_core\application.py", line 50, in start
super(JupyterContribApp, self).start()
File "C:\Users\sammy\Anaconda3\lib\site-packages\jupyter_core\application.py", line 255, in start
self.subapp.start()
File "C:\Users\sammy\Anaconda3\lib\site-packages\jupyter_contrib_nbextensions\application.py", line 226, in start
super(ContribNbextensionsApp, self).start()
File "C:\Users\sammy\Anaconda3\lib\site-packages\jupyter_core\application.py", line 255, in start
self.subapp.start()
File "C:\Users\sammy\Anaconda3\lib\site-packages\jupyter_contrib_nbextensions\application.py", line 175, in start
toggle_install_config(self._toggle_value, **kwargs)
File "C:\Users\sammy\Anaconda3\lib\site-packages\jupyter_contrib_nbextensions\install.py", line 103, in toggle_install_config
configurator_app.start()
File "C:\Users\sammy\Anaconda3\lib\site-packages\jupyter_nbextensions_configurator\application.py", line 77, in start
user=self.user, sys_prefix=self.sys_prefix)
File "C:\Users\sammy\Anaconda3\lib\site-packages\notebook\nbextensions.py", line 351, in _set_nbextension_state
cm.update(section, {"load_extensions": {require: state}})
File "C:\Users\sammy\Anaconda3\lib\site-packages\traitlets\config\manager.py", line 85, in update
data = self.get(section_name)
File "C:\Users\sammy\Anaconda3\lib\site-packages\traitlets\config\manager.py", line 63, in get
return json.load(f)
File "C:\Users\sammy\Anaconda3\lib\json\__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "C:\Users\sammy\Anaconda3\lib\json\__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Users\sammy\Anaconda3\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\sammy\Anaconda3\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 6 column 22 (char 137)
知道问题可能出在哪里吗?非常感谢!