Gooey icon indicating copy to clipboard operation
Gooey copied to clipboard

No status info is showed anymore after pyinstaller pkg to one exe file... What should I do next?

Open huyangnl opened this issue 1 year ago • 5 comments

Gooey: Lastest Version Python: 3.10

The first screenshot is BEFORE pyinstaller, there are much info showed in status windows.

截屏2023-05-16 22 43 38

The second screenshot is AFTER pyinstaller, no status anymore..

截屏2023-05-16 22 43 06

sometimes, some words jump out:

截屏2023-05-16 22 44 45

huyangnl avatar May 16 '23 20:05 huyangnl

I have the same issue with Python 3.6 and Gooey 1.2.0-alpha

m-ad avatar May 24 '23 14:05 m-ad

This seems to be a duplicate of https://github.com/chriskiehl/Gooey/issues/701

Workaround: Add flush=True to all print statements:

print("foo", flush=True)

Alternatively, modify the print statement to always flush (careful with this, it's usually a bad idea to modify/overwrite built-ins):

import functools
print = functools.partial(print, flush=True)

print("foo")  # this uses flush=True now

m-ad avatar May 24 '23 14:05 m-ad

Finally I use loguru ... put all printout to debug.log...

huyangnl avatar May 26 '23 22:05 huyangnl

Finally I use loguru ... put all printout to debug.log...

The same problem, I finally modified the functions _extract_progress and _forward_stdout in processor.py to change the decoding method to gbk,it seems to be working normally

keymou avatar Jun 15 '23 02:06 keymou

When building it with pyinstaller you need to set the option u for unbuffered. Then flushing on print is not needed.

Example:

pyinstaller --onefile --windowed --python-option u python_script.py

see more details here

sliverc avatar Jun 20 '23 13:06 sliverc