python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.42k stars 586 forks source link

PermissionError: [Errno 13] Permission denied: 'node_modules/electron/dist/Electron.app' with Electron #604

Closed VellichorPrism closed 2 years ago

VellichorPrism commented 2 years ago

Hello, I am trying to use eel with Electron. Below is the code I'm using to start eel, which I'm using for both Windows and Mac.

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

It works fine on my Windows machine, however, when I switch over to my Mac, this is when I get errors. The first error I get with running the above code on Mac is FileNotFoundError: [Errno 2] No such file or directory: 'node_modules/electron/dist/Electron' (this is no problem on Windows though). So, I added '.app' to the path to see if that would help eel locate the file.

eel.init('web')
eel.browsers.set_path('electron', 'node_modules/electron/dist/Electron.app')  # Added .app to path
eel.start('index.html', size=(500, 500), mode='electron')

Now it gives PermissionError: [Errno 13] Permission denied: 'node_modules/electron/dist/Electron.app'. Note that both errors occur during the subprocess.Popen call in electron.py, so perhaps it has something to do with how subprocess works bewteen operating systems? I have been googling but haven't figured anything out.

If anyone has a clue on what might be the problem, I would appreciate any help greatly. Thank you!

Version Info: eel - 0.14.0 python - 3.9.6 macOS - 10.15.7

VellichorPrism commented 2 years ago

I also tried with python 3.8.10, but no change in behavior.

VellichorPrism commented 2 years ago

After more inspection, the path on Mac needs to be specified as node_modules/electron/dist/Electron.app/Contents/MacOS/Electron. I might open a new issue labeled bug for this.

iWhiver commented 2 years ago

After more inspection, the path on Mac needs to be specified as node_modules/electron/dist/Electron.app/Contents/MacOS/Electron. I might open a new issue labeled bug for this.

thank you! I thought that problem about npm and chmod :)