VSCode无法将jupyter笔记本导出到html

问题描述

我在VSCode中有一个jupyter笔记本,我正尝试使用VSCode中的内置按钮将其导出到html,但是我一直收到此错误,指出找不到‘jupyter-nbConvereter’。

我正在使用pip,并让pip安装我能安装的任何与jupyter相关的东西:jupyter、jupyterlab、nbConvert、笔记本。

您知道可能是什么原因导致此问题吗?我正在使用Windows 10。

> C:Python38python.exe c:UsersToshiba.vscodeextensionsms-python.python-2020.9.114305pythonFilespyvsc-run-isolated.py jupyter nbconvert --version
> C:Python38python.exe c:UsersToshiba.vscodeextensionsms-python.python-2020.9.114305pythonFilespyvsc-run-isolated.py jupyter nbconvert --version
Error 2020-10-26 10:40:19: Export failed [r [Error]: Traceback (most recent call last):
  File "c:UsersToshiba.vscodeextensionsms-python.python-2020.9.114305pythonFilespyvsc-run-isolated.py", line 26, in <module>
    runpy.run_module(module, run_name="__main__", alter_sys=True)
  File "C:Python38libunpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "C:Python38libunpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "C:Python38libunpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:UsersToshibaAppDataRoamingPythonPython38site-packagesjupyter.py", line 4, in <module>
    main()
  File "C:UsersToshibaAppDataRoamingPythonPython38site-packagesjupyter_corecommand.py", line 247, in main
    command = _jupyter_abspath(subcommand)
  File "C:UsersToshibaAppDataRoamingPythonPython38site-packagesjupyter_corecommand.py", line 133, in _jupyter_abspath
    raise Exception(
Exception: Jupyter command `jupyter-nbconvert` not found.


解决方案

  1. pip uninstall nbconvert

  2. 以管理员身份运行CMD

  3. pip install nbconvert

我也遇到了同样的问题,按照上面的步骤解决了它。此解决方案来自this thread

相关文章