Electron package
See original GitHub issueI love this project, it becomes so easy to develop beautiful GUI for python apps and the abstraction is great. In my last project, I switched from the Chrome browser to Electron so I could customise the windows appearance and behaviour. It works almost flawlessly; I can’t package the app anymore.
I also tried to use a local Electron release and use relative paths
# eel.browsers.set_path('electron', 'node_modules/electron/dist/Electron.app/Contents/MacOS/electron')
eel.browsers.set_path('electron', 'Electron.app/Contents/MacOS/electron')
And tried adding the Electron app to the pyinstaller command:
python3 -m eel main.py web --noconfirm --noconsole --onefile \
--add-data /AbsolutePathTo/Electron.app:Electron.app \
--add-data electron_main.js:Electron.app/Contents/Resources/app
My different tries result in different errors such as
FileNotFoundError: [Errno 2] No such file or directory: 'Electron.app/Contents/MacOS/electron': 'Electron.app/Contents/MacOS/electron'
()
or
Cannot find module '/Users/xyz'. Require stack: /usr/local/lib/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js
I started from the Eelectron example with macOS 10.15 / python 3.7.7 / pyinstaller 3.6
Has anyone achieved this and is willing to help me?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6
Top GitHub Comments
Same here but in windows. When packaging (without --onefile), there exists a file in
\node_modules\electron\dist\resources\
nameddefault_app.asar
with ~100kb. If I remove that file and then create a folder with the same name with themain.js
inside, the app neither run nor any message is shown nor in windows cmd.Some lucky here, I was able to package it using
python -m eel --add-data="main.js;." --add-data="node_modules;node_modules" --add-data="package-lock.json;." --add-data="package.json;." --noconfirm main.py web
this error you guys are getting because it’s missing package-lock.json and package.jsonbut when I try use
--onefile
I get this error when executing the exe :v