question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
roommcommented, Apr 17, 2021

Same here but in windows. When packaging (without --onefile), there exists a file in \node_modules\electron\dist\resources\ named default_app.asar with ~100kb. If I remove that file and then create a folder with the same name with the main.js inside, the app neither run nor any message is shown nor in windows cmd.

0reactions
lucasadsouzacommented, Dec 19, 2022

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.json

but when I try use --onefile I get this error when executing the exe :v

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron Packager - GitHub
Electron Packager is a command line tool and Node.js library that bundles Electron-based application source code with a renamed Electron ...
Read more >
Packaging Your Application | Electron
Electron Forge is an all-in-one tool that handles the packaging and distribution of Electron apps. Under the hood, it combines a lot of...
Read more >
Electron packager tutorial - Christian Engvall
"Electron Packager is a command line tool and Node.js library that bundles Electron-based application source code with a renamed Electron ...
Read more >
electron-builder
A complete solution to package and build a ready for distribution Electron app for macOS, Windows and Linux with “auto update” support out...
Read more >
Options | electron-packager
Documentation for electron-packager.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found