You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across the following error message when converting a notebook containing SVGs to PDF on Windows (jupyter nbconvert mynotebook.ipynb --to=pdf):
File "c:\users\username\appdata\local\programs\python\python38\lib\site-packages\nbconvert\preprocessors\svg2pdf.py", line 158, in convert_figure
raise TypeError("Inkscape svg to pdf conversion failed")
TypeError: Inkscape svg to pdf conversion failed
I noticed that if I add a pause between the existence check of the output file and the subprocess call in convert_figure, it works fine, indicating some sort of synchronization problem. I then also noticed that the inkscape in PATH was not from the normal inkscape installation directory, but rather: C:\ProgramData\chocolatey\bin\inkscape.EXE, which is a "chocolatey shim" and apparently does not wait for the command to finish before exiting, or does not fsync, or something. The solution is to explicitly add the inkscape installation directory bin before the chocolatey bin directory in PATH.
This is obviously not a bug in nbconvert, but rather chocolatey, but for posterity and others it might be good to have this as a reference. Feel free to close immediately.
Nbconvert version: 6.1.0
The text was updated successfully, but these errors were encountered:
mueslo
changed the title
Inkscape svg to pdf conversion fails with Inkscape [Windows, chocolatey shim]
Inkscape svg to pdf conversion fails on Windows with chocolatey
Aug 24, 2021
I came across the following error message when converting a notebook containing SVGs to PDF on Windows (
jupyter nbconvert mynotebook.ipynb --to=pdf
):I noticed that if I add a pause between the existence check of the output file and the subprocess call in
convert_figure
, it works fine, indicating some sort of synchronization problem. I then also noticed that the inkscape inPATH
was not from the normal inkscape installation directory, but rather:C:\ProgramData\chocolatey\bin\inkscape.EXE
, which is a "chocolatey shim" and apparently does not wait for the command to finish before exiting, or does not fsync, or something. The solution is to explicitly add the inkscape installation directory bin before the chocolatey bin directory inPATH
.This is obviously not a bug in nbconvert, but rather chocolatey, but for posterity and others it might be good to have this as a reference. Feel free to close immediately.
Nbconvert version: 6.1.0
The text was updated successfully, but these errors were encountered: