-
-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eel not working when using cx_freeze #371
Comments
Can I ask why you need to use cx_freeze rather than pyinstaller? |
Because of the thousand users I've had, about 25% of them had issues with pyinstaller. For example, for some, it will simply not open anything, I've had to remote desktop into a user's PC and could not figure it out, the process starts then exits, no output in console, or anything. It also doesn't load at all for me if the exe is launched from within a network drive, also, I've had multiple times where the generated exe was getting flagged as a virus by various antivirus software, such as Windows Defender. Overall, I've been using pyinstaller for nearly a year and grew tired of fighting against it, tried cx_freeze, it gives bigger files (a 300MB instead of 95MB directory) due to how it brings in pyside dependencies (still trying to figure out how to remove that dep), but otherwise, when pyinstaller wasn't working for people, cx_freeze was working fine. I gave pyinstaller a try, now I want to give cx_freeze a try. Regardless, there are multiple freezing choices in the python community, and giving the choice of the user seems sensible rather than forcing a single choice :) |
cx_freeze frozen apps don't define/use _MEIPASS Fixes python-eel#371
I use cx_freeze rather than pyinstaller in some cases. Pyinstaller executable sometimes takes much time to start up than cx_freeze. I created another pull request. |
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 inget_real_path
and usesys._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.
The text was updated successfully, but these errors were encountered: