From 660b0b07c0e53bb8ef64601aa08b61a351217310 Mon Sep 17 00:00:00 2001 From: chriskiehl Date: Sat, 7 Nov 2015 16:20:33 -0500 Subject: [PATCH] read from pyinstaller temp dir when frozen --- gooey/gui/util/freeze.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gooey/gui/util/freeze.py b/gooey/gui/util/freeze.py index e1c5303..7e36bf0 100644 --- a/gooey/gui/util/freeze.py +++ b/gooey/gui/util/freeze.py @@ -8,7 +8,9 @@ def is_frozen(): def get_resource_path(*args): if is_frozen(): - resource_dir = os.path.join(os.path.dirname(sys.executable), 'gooey') + # MEIPASS explanation: + # https://pythonhosted.org/PyInstaller/#run-time-operation + resource_dir = os.path.join(sys._MEIPASS, 'gooey') if not os.path.isdir(resource_dir): raise IOError(("cannot locate Gooey resources. It seems that the program " "was frozen, but resource files were not copied to "