From 53a070eff04c0b518f6d1590ef902a7e3d9341c2 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 19 Aug 2018 14:57:55 -0400 Subject: [PATCH] Backport PR #11847: Use ImageMagick's magick.exe if convert.exe is not installed --- lib/matplotlib/animation.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 9dd3f68f0a8c..afe466e0af06 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -735,10 +735,17 @@ def _init_from_registry(cls): 0, winreg.KEY_QUERY_VALUE | flag) binpath = winreg.QueryValueEx(hkey, 'BinPath')[0] winreg.CloseKey(hkey) - binpath += r'\convert.exe' break except Exception: binpath = '' + if binpath: + for exe in ('convert.exe', 'magick.exe'): + path = os.path.join(binpath, exe) + if os.path.exists(path): + binpath = path + break + else: + binpath = '' rcParams[cls.exec_key] = rcParamsDefault[cls.exec_key] = binpath @classmethod