Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inkscape svg to pdf conversion fails on Windows with chocolatey #1619

Open
mueslo opened this issue Aug 24, 2021 · 0 comments
Open

Inkscape svg to pdf conversion fails on Windows with chocolatey #1619

mueslo opened this issue Aug 24, 2021 · 0 comments

Comments

@mueslo
Copy link

mueslo commented 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):

  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

@mueslo 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant