Pyinstaller --windowed or --noconsole .exe not allowing chromedriver to open

17,439

Solution 1

I know that this question has been since 2016, but I would like to share my knowledge.

Try to put --noconsole before --onefile.

So, the command will be:

pyinstaller --noconsole --onefile --windowed --icon=favicon.ico main.py

Solution 2

In Python 2.7 use subprocess like this:

DEVNULL = open(os.devnull,"wb")
output = subprocess.check_output(command, shell=True,stderr=DEVNULL,stdin=DEVNULL)

In Python 3 use subprocess like this:

DEVNULL = subprocess.DEVNULL
output=subprocess.check_output(command,shell=True, stderr = DEVNULL , stdin = DEVNULL )

Hopefully it will solve your problem.

Solution 3

add --noconsole flag to your script call and remove --windowed, I tested this and it worked for me.

this would be :

pyinstaller --noconsole --icon=favicon.ico main.py

Solution 4

Change the extension of your main (GUI) file. From: *.py to *.pyw (Python officially supported).

Then: pyinstaller --onefile --noconsole main.pyw

This worked for me.

Share:
17,439
Jamie Smith
Author by

Jamie Smith

Updated on July 21, 2022

Comments

  • Jamie Smith
    Jamie Smith almost 2 years

    I have a python program that I am converting to a .exe file. I have compiled with Pyinstaller and all is working fine. I now want to get rid of the console window as I have a pyqt user interface. I have tried:

    pyinstaller --onefile --windowed --icon=favicon.ico main.py
    

    Its compiling fine and running however when chromedriver is activated it doesnt show up. It works fine when i do not use --windowed or --noconsole.

    Anyone had this problem before?

    Thanks Jamie