You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
Describe the problem
I'm having problems whenever I use the --noconsole flag. When I create the executable just using --onefile everything works correctly, however, the terminal opens every time I run the .exe executable (which is a problem). I hope you can help me with this problem, I'll leave the image of the error that occurs whenever I have to run the executable created with the --noconsole flag.
OS: windows 11
Browser chrome
UPDATE 1:
I created a simple project from scratch with just the eel library, a single python file and a simple html file and when using --noconsole the same problem I described in the image above occurred, which leads me to believe that it is an error in the Library. I need urgent help, because I bet all the development of my project on this library. Thank you for any help.
UPDATE 2:
I managed to work around the problem but not solve it. I used the following:
The terminal opening is a side-effect of an underlying issue that eel can't instantiate correctly. Even if you redirect the output to a file to prevent the console from opening, eel will most likely have trouble running. Eel uses pyinstaller to create a .spec file and build into a standalone application; line 15 of __init__.py is the import of bottle so the problem is somewhere in how pyinstaller is packaging your app, not necessarily with eel directly.
Also, redirecting stdout or stderr will likely mask a problem if your application does have a failure. Better practice is to configure python logging to redirect exceptions to a log file. print should be turned into logger.info or logger.debug so that you have insight into your running application.
I had the same issue. Only I modified the bottle.py file online 73 like this:
try:
_stdout = sys.stdout.write if sys.stdout is not None else lambda x: None
_stderr = sys.stderr.write if sys.stderr is not None else lambda x: None
except AttributeError:
_stdout = lambda x: None
_stderr = lambda x: None
to properly handle my custom logger. After that my noconsole builds were working.
Activity
Nriver commentedon Aug 21, 2023
related issue #654
ajmirsky commentedon Aug 23, 2023
The terminal opening is a side-effect of an underlying issue that eel can't instantiate correctly. Even if you redirect the output to a file to prevent the console from opening, eel will most likely have trouble running. Eel uses
pyinstallerto create a.specfile and build into a standalone application; line 15 of__init__.pyis the import ofbottleso the problem is somewhere in howpyinstalleris packaging your app, not necessarily with eel directly.Also, redirecting
stdoutorstderrwill likely mask a problem if your application does have a failure. Better practice is to configure python logging to redirect exceptions to a log file.printshould be turned intologger.infoorlogger.debugso that you have insight into your running application.chrislilley13 commentedon Oct 31, 2023
I had the same issue. Only I modified the bottle.py file online 73 like this:
try:
_stdout = sys.stdout.write if sys.stdout is not None else lambda x: None
_stderr = sys.stderr.write if sys.stderr is not None else lambda x: None
except AttributeError:
_stdout = lambda x: None
_stderr = lambda x: None
to properly handle my custom logger. After that my noconsole builds were working.