如何解决 JupyterLab 中的 'nbconvert failed: Inkscape svg to pdf conversion failed`

How to solve 'nbconvert failed: Inkscape svg to pdf conversion failed` in JupyterLab

我正在使用命令 %config InlineBackend.figure_format = 'svg' 获得高质量图像。然后我Export Notebook to PDF遇到错误

  1. 我安装了 Inscape 并按照建议 here.

    在文件 jupyter_notebook_config.py 中添加了行 c.SVG2PDFPreprocessor.inkscape = 'C:\Program Files\Inkscape\bin\inkscape.exe'
  2. 我按照建议安装了 nbconvert 6.0.0 here

遗憾的是,它们都不起作用。能否请您详细说明如何解决这个问题?

我用

我找到了 Windows 10.

的解决方案
  1. 在不包含 space 的路径中安装 Inkscape。就我而言,它是 C:\Inkscape.

  2. 将包含 inkscape.exe 的文件夹添加到 environment variable 中。在我的例子中,这个文件夹是 C:\Inkscape\bin.

  1. 使用命令 conda update nbconvert --yes 更新 nbconvert。就我而言,我改为通过 conda update --all --yes.
  2. 更新所有包