From 5c95abdbb8f0a04fa5327ce921bd0c312c1fadce Mon Sep 17 00:00:00 2001 From: Semen Miroshnichenko Date: Fri, 31 Jul 2020 10:46:07 +0200 Subject: [PATCH] Handle the case when ImageTk is not installed --- Source/Dialog.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Dialog.py b/Source/Dialog.py index 480967a..2bfc737 100644 --- a/Source/Dialog.py +++ b/Source/Dialog.py @@ -40,7 +40,12 @@ import tkinter.font import PIL -from PIL import Image, ImageTk, ExifTags +from PIL import Image, ExifTags +try: + from PIL import ImageTk +except ImportError: + raise ("ImageTk not installed. If running Python 3.x\n" \ + "Use: sudo apt-get install python3-pil.imagetk") from Utils import UnderConstruction from Tooltip import *