Closed Andres-celi closed 4 years ago
Hi @Andres-celi. Based on the example here, it looks like you should be passing in options as eel.start('index.html', options=options)
. At the moment you're creating an options
dict but not using it anywhere.
This might give you deprecation warnings, though. You should probably go for the following:
eel.start('index.html', mode='custom', cmdline_args=['node_modules/electron/dist/electron.exe', '.'])
Hi @samuelhwilliams thanks for the response. As I mentioned, among others, I tried that approach too. If I use the following:
eel.init('app1')
eel.start('index.html',mode='custom', cmdline_args=['node_modules/electron/dist/electron.exe', '.'])
I get this:
Traceback (most recent call last):
File "/home/pi/main.py", line 298, in
and this is the path contents:
pi@alba2:~/app1/node_modules/electron/dist $ ls chrome_100_percent.pak libGLESv2.so resources.pak chrome_200_percent.pak libvk_swiftshader.so snapshot_blob.bin chrome-sandbox libvulkan.so swiftshader electron LICENSE v8_context_snapshot.bin icudtl.dat LICENSES.chromium.html version libEGL.so locales vk_swiftshader_icd.json libffmpeg.so resources
electron is in there :/
On the other hand, if I use this:
eel.init('app1') eel.start('index.html', mode='custom', cmdline_args=['/home/pi/app1/node_modules/electron/dist/electron', '.'])
it runs and then nothing. No errors and no app either. Is this an improvement? Not really sure Lol.
I think this is just a .bat script which points to the actual .exe. Popen
needs the path to the .exe, it can't deal with the .bat
I thought the mode='electron'
should deal with all this though... You shouldn't need to specify the path yourself. Are you in the latest version?
Sorry wait are you on Mac? (Got confused by the .exe ref).
Either way, it should work to just say mode='electron'
with no further options
Hello @ChrisKnott , my bad for not clarifying. I am using a Raspberry Pi 3 B+. When I use mode='electron'
I get the following error:
Traceback (most recent call last):
File "/home/pi/main.py", line 299, in
So the way I went is the following:
eel.init('app1')
eel.start('index.html',block=False, mode='custom', cmdline_args=['/home/pi/app1/node_modules/electron/dist/electron', '.'])
os.system('electron app1/main.js --disable-gpu'+ " &")
this starts the webserver on python, but then opens the electron app from cmd line. It works but I was wondering if the app should open by itself?. By the way I am using the last version available of eel.
Are you using IDLE?
I'm going to close this now based on inactivity. It does seem to be an IDLE error from quick googling ... hopefully you've found and fixed the problem now.
Hello, I have been trying to get Eel to run on Electron with no luck.
import eel
options = { 'mode': 'custom', 'args': ['node_modules/electron/dist/electron.exe', '.'] }
if __name__ == "__main__":
eel.init('app')
eel.start('index.html',mode='electron')
Options are not being used anymore because of the update. But I get the following error:
Traceback (most recent call last): File "/home/pi/main.py", line 298, in
eel.start('index.html',mode='electron')
File "/home/pi/.local/lib/python3.5/site-packages/eel/init.py", line 142, in start
show(*start_urls)
File "/home/pi/.local/lib/python3.5/site-packages/eel/init.py", line 170, in show
brw.open(start_urls, _start_args)
File "/home/pi/.local/lib/python3.5/site-packages/eel/browsers.py", line 64, in open
browser_module.run(path, options, start_urls)
File "/home/pi/.local/lib/python3.5/site-packages/eel/electron.py", line 11, in run
sps.Popen(cmd, stdout=sys.stdout, stderr=sys.stderr, stdin=sps.PIPE)
File "/usr/lib/python3.5/subprocess.py", line 640, in init
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "/usr/lib/python3.5/subprocess.py", line 1135, in _get_handles
c2pwrite = stdout.fileno()
io.UnsupportedOperation: fileno
I have gone through the various posts in here and well. Nothing has worked for me so far. I would love some help.
Thank you