2

I am trying to compile a complex script into an exe with PyInstaller, this is the install command I am currently using although I have tried many variations of these flags: pyinstaller -w -F --debug=all --noupx --name godnesssakes .\uhoh.py

When I run the exe from the command line I get no output whatsoever, even with debug mode enabled: enter image description here

Even after simplifying my python script to a simple print command I am still getting no output:

def main():
    print('test')

main()

I have tried everything including reinstalling python, reinstalling pip, verifying path, verifying no conflicting versions, using --path flag in pyinstaller...

Versions:

  • Python 3.9.9
  • Pyinstaller 5.4.1

Answers that have NOT helped:

zbarnz
  • 315
  • 1
  • 8

1 Answers1

1

Follow each of these steps... or use your operating system's equvalent.

  1. mkdir newdir and cd newdir
  2. py -m venv venv and venv\Scripts\activate
  3. py -m pip install --upgrade pip pyinstaller
  4. copy your script into the newdir/main.py

To make it even more obvious:....

def main():
    while True:
        print('test', end='\r')

main()
  1. pyinstaller -F --debug=all --noupx --name goodnesssakes main.py
  2. dist\goodnesssakes.exe

The actual problem is that you are using the -w flag which tells pyinstaller that it is a windowed application and therefore doesn't output anything to the console. It is literally and alias for --noconsole

Alexander
  • 16,091
  • 5
  • 13
  • 29