我在 Mint 20.1 中使用 aptitude 安装了 jupyter notebook。我正在尝试使用它来安装 nbextensions,
jupyter contrib nbextension install --user
引发错误,
Traceback (most recent call last):
File "/home/prasanta/.local/bin/jupyter-contrib", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3/dist-packages/jupyter_core/application.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 662, in launch_instance
app = cls.instance(**kwargs)
File "/usr/lib/python3/dist-packages/traitlets/config/configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "/home/prasanta/.local/lib/python3.8/site-packages/jupyter_contrib_core/application.py", line 27, in __init__
self._refresh_subcommands()
File "/home/prasanta/.local/lib/python3.8/site-packages/jupyter_contrib_core/application.py", line 43, in _refresh_subcommands
get_subcommands_dict = entrypoint.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2444, in load
self.require(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2467, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (traitlets 4.3.3 (/usr/lib/python3/dist-packages), Requirement.parse('traitlets>=5.0'), {'nbconvert'})
解决办法是什么?nbextension安装导致问题的情况很多,我没有发现类似的问题。还有其他安装方式(通过conda)吗?