From e32bfcde4a8cbe160d85a7fb3c1e1e1433f84618 Mon Sep 17 00:00:00 2001 From: Jonathan Singer Date: Mon, 20 Jul 2026 12:23:06 -0400 Subject: [PATCH] Bundle Pillow so the frozen binary can build PDF reports reportlab imports PIL lazily and it was in the PyInstaller excludes list, so report generation crashed in the packaged binary. --- strix.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/strix.spec b/strix.spec index 2016db03..d3b21202 100644 --- a/strix.spec +++ b/strix.spec @@ -206,6 +206,11 @@ hiddenimports += collect_submodules('reportlab') # reportlab ships bundled fonts (.pfb/.afm) it needs at runtime. datas += collect_data_files('reportlab') +# reportlab imports PIL (pillow) lazily for image handling, so it must be +# bundled explicitly and kept out of the excludes list below. +hiddenimports += collect_submodules('PIL') +datas += collect_data_files('PIL') + excludes = [ # Sandbox-only packages 'playwright', @@ -252,7 +257,6 @@ excludes = [ 'numpy', 'pandas', 'scipy', - 'PIL', 'cv2', ]