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.

How to use eel with electron using mode='electron'?

See original GitHub issue

Hello!! I only have very little knowledge about node.js, so I could not use electron. But eel seems pretty easy to get started with. My system only has firefox installed, so the program I wrote didnā€™t run initially. And although using mode = 'chrome-app' allowed me to run the app, it opens as a new tab on my browser. I was going through the documentation just now, and I saw the following line that really got me excited:

mode, a string specifying what browser to use (e.g. ā€˜chromeā€™, ā€˜electronā€™, ā€˜edgeā€™, ā€˜customā€™). Can also be None or False to not open a window. Default: ā€˜chromeā€™

So, I installed electron using npm and wrote the following dummy code to check if it works.

import eel
PORT = 8001

eel.init("./static")

@eel.expose
def print_booking_status(x, date):
    if(x==True):
        print(f"Booked Successfully for date {date}")
    else:
        print("Booking Cancelled");

eel.start("index.html", mode='electron', port=PORT)

But Iā€™m getting an error that says electron installation was not found.

OSError: Canā€™t find Electron installation

I also tried a global installation of electron, but it still didnā€™t work. Can anyone provide any suggestions to run my code through electron? And is it even possible?

  • I know that if I donā€™t provide a sample code that allows someone to quickly step into my shoes, I may not get the help I want or my issue may be closed.

Desktop (please complete the following information):

  • OS: GNU Linux (Pop!_OS)
  • Browser: Firefox
  • Version: 88.0.1

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
mouadessalimcommented, Aug 5, 2021
import eel
import eel.browsers

eel.init('web')
eel.browsers.set_path('electron', 'node_modules/electron/dist/electron')
eel.start('web/index.html', mode='electron')

like this šŸ˜

2reactions
Muhammad-Taif-Khancommented, Jun 21, 2021

To use electron with eel try checking the example below: https://github.com/ChrisKnott/Eel/tree/master/examples/09 - Eelectron-quick-start

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use eel with electron using mode='electron'? #491
So, I installed electron using npm and wrote the following dummy code to check if it works. import eel PORT = 8001 eel.init("./staticĀ ......
Read more >
How to load Electron + EEL in python - Stack Overflow
I am Trying to use Electron browser using EEL. my problem is electron can not load the index.html page. Python file :
Read more >
Eel vs Electron | What are the differences? - StackShare
Eel - A little Python library for making simple Electron-like HTML/JS GUI apps. Electron - Build cross platform desktop apps with JavaScript, HTML,...
Read more >
Eel - Bountysource
I'm attempting to use Electron with Eel in the latest versions. The 'mode='electron'' option only yielded me this: Script: import eel eel.init('web')Ā ...
Read more >
Atomic-Resolution Characterization Using the Aberration ...
This paper will demonstrate the capabilities of the JEOL JEM-ARM200CF at the University of Illinois at Chicago, a probe aberration-corrected STEM equipped withĀ ......
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