python-eel/Eel

Electron package

Open

#266 aperta il 2 apr 2020

Vedi su GitHub
 (7 commenti) (1 reazione) (0 assegnatari)Python (570 fork)batch import
help wanted

Metriche repository

Star
 (5980 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I 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?

Guida contributor