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.

eel not working when using cx_freeze #371

@kakaroto

Description

@kakaroto

Eel version
master

Describe the bug
When using cx_freeze to freeze the app, it will fail to start due to sys._MEIPASS not being defined

Additional context
in eel/__init__.py , you check for whether the app was frozen in get_real_path and use sys._MEIPASS if that's the case. However, that only works specifically for pyinstaller. In the case of cx_freeze, the app is considered frozen but there is no _MEIPASS defined and you can use the path normally.

I tracked down the bug and the issue to a similar fix in another project and you can see their fix for it here :
https://github.com/bokeh/bokeh/pull/8324/files

Adding and hasattr(sys, '_MEIPASS'): to line 297 of init.py (https://github.com/samuelhwilliams/Eel/blob/master/eel/__init__.py#L297) fixed it for me and I can confirm that eel is working (and it's working great!)
I didn't feel like such a small change deserved for me to do a fork and PR but if you'd prefer I do that, let me know and I can send you a PR instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions