Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b65d42

Browse files
author
Joshua Taillon
authored
Try to use --without-gui for inkscape first
1 parent ce0f5bd commit 3b65d42

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,12 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
330330
message = "Failed to find a Ghostscript installation"
331331
raise ExecutableNotFoundError(message)
332332
elif name == "inkscape":
333-
# use "no-gui" option for inkscape version detection:
334-
info = impl(["inkscape", "-z", "-V"], "^Inkscape ([^ ]*)")
333+
try:
334+
# use "without-gui" option (only works with inkscape version < 1.0):
335+
info = impl(["inkscape", "--without-gui", "-V"], "Inkscape ([^ ]*)")
336+
except subprocess.CalledProcessError as _cpe:
337+
# for inkscape v > 1.0, --without-gui is not needed:
338+
info = impl(["inkscape", "-V"], "Inkscape ([^ ]*)")
335339
if info and info.version >= "1.0":
336340
raise ExecutableNotFoundError(
337341
f"You have Inkscape version {info.version} but Matplotlib "

0 commit comments

Comments
 (0)