Skip to content
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
This repository was archived by the owner on Jun 22, 2025. It is now read-only.

Error while running the eel project exe file with no console #700

Open

Description

@Satya9348

I have converted my eel project to an executable file with console and It is running smoothly. But whenever I tries it with no console it makes an exe file but gives me error whenever I opens it. The error is below.
Traceback (most recent call last):
File "main.py", line 1, in
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
File "eel_init
.py", line 15, in
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
File "bottle.py", line 73, in
AttributeError: 'NoneType' object has no attribute 'write'

Plese help me with it...

Activity

  1. gxsshallot commented on Sep 7, 2023

    @gxsshallot

    same issue +1

  2. artydev commented on Sep 22, 2023

    @artydev

    same issue +1

  3. plusseed commented on Nov 30, 2023

    @plusseed

    Eel is importing a bottle,
    but AttributeError cannot be caught in bottle.py

    https://docs.python.org/3.11/library/sys.html?highlight=sys#module-sys

    It is written as below.

    Note Under some conditions stdin, stdout and stderr as well as the original values __stdin__, __stdout__ and __stderr__ can be None. It is usually the case for Windows GUI apps that aren’t connected to a console and Python apps started with pythonw.
    

    There is also a way to edit bottle.py directly,
    but I assign null to stdout and stderr and throw it away.

    import os
    import sys
    sys.stdout = open(os.devnull, 'w')
    sys.stderr = open(os.devnull, 'w')
    import eel
    

    Sorry, Generated by translation

  4. plusseed commented on Nov 30, 2023

    @plusseed

    related issue #654, #698

  5. gorkemgul commented on Dec 20, 2023

    @gorkemgul

    Eel is importing a bottle, but AttributeError cannot be caught in bottle.py

    https://docs.python.org/3.11/library/sys.html?highlight=sys#module-sys

    It is written as below.

    Note Under some conditions stdin, stdout and stderr as well as the original values __stdin__, __stdout__ and __stderr__ can be None. It is usually the case for Windows GUI apps that aren’t connected to a console and Python apps started with pythonw.
    

    There is also a way to edit bottle.py directly, but I assign null to stdout and stderr and throw it away.

    import os
    import sys
    sys.stdout = open(os.devnull, 'w')
    sys.stderr = open(os.devnull, 'w')
    import eel
    

    Sorry, Generated by translation

    definitely works, much obliged.

  6. IshuSinghSE commented on Jul 17, 2024

    @IshuSinghSE

    Thanks for the workaround, You're not less than Hacker 🧑‍💻😁

    ArabicGamerHackerMemeGIF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions