Uncaught Error: spawn python3 ENOENT
See original GitHub issueHey,
I’m trying to use python shell with electron.
Everything works fine, when I’m running the app with electron .
, but when I build it with electron-builder
and run .app file, it doesn’t work and console is giving me:
Uncaught Error: spawn python3 ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:246)
at onErrorNT (internal/child_process.js:429)
at processTicksAndRejections (internal/process/task_queues.js:81)
Do anyone have this experience and know hove to solve it?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
spawn python ENOENT node.js in windows - Stack Overflow
When running the code on his windows machine it gives this stacktrace. events.js:174 throw er; // Unhandled 'error' event ^ Error: spawn python ......
Read more >Midi Error: spawn python3 ENOENT (python not found ...
If I launch OSC using node, when I ask for the midi list, it doesn't show any information, if I launch the Mac...
Read more >SLS Deploy Error in Python: Error: spawn python3.8 ENOENT
ubuntu@jumpboxAndawscli:/data/integrations$ sudo sls deploy --stage prod Serverless: Configuration warning at 'provider': unrecognized ...
Read more >How I fixed "Error: spawn python ENOENT" when upgrading
I run node-red in Docker and use the node-red-contrib-python-function node. My instance got stuck in a reboot loop when I upgraded to node-red ......
Read more >[Solved-5 Solutions] Error spawn enoent on node.js - Wikitechy
Spawn may emit the ENOENT error if the filename command (i.e, 'some-command') does not exist in at least one of the directories defined...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@blahafrank @benjaminbaker-dev @lavchandaria
I have faced the exact same issue today. After a good headache I figured it out, so I thought I’d share what I did:
including the whole python virtual environment as a set of resource files, taking care to replace the default symlinked python binaries with a copy of them(this is a bad idea — see my reply below for a better solution)npm start
to confirm everything works as intended)path.join(__dirname, filePath)
for all relativefilePath
; the file system of the built application does not work with plain relative paths. This applies to everything; the targeted python environment itself, the python file, and any files accessed from within the spawned process. In my case, since my python process reached for some included files and I didn’t want to pass__dirname
as an argument, I retrieved it from within python withpathlib.Path(__file__).parent.absolute()
(this assumes the python file sits at the project root)While trying to figure this out, debugtron was helpful in providing debug output for the built version of the app.
I am not quite sure of this but I believe fix-path may resolve the issue of linking python properly if you aren’t using a virtual environment — I have seen it mentioned around on StackOverflow regarding similar issues.
I know this is probably an old problem no longer relevant to the authors, but hopefully this helps some future internet people.
@blahafrank @develar Hey were you able to solve this ? I’m having the same issue with .app file on OSX. I’m pretty sure it’s related to PATH issues - because when I use python instead of python3 all is well. I tried to fix problem by editing /etc/paths and adding python3 but to no avail. @develar - any ideas ? where does child_process.spawn() get PATH from ? Thank you 😃