How to package python with electron, how does JupyterLab do?

As an Electron app developer, I’m curious how JupyterLab package a full python environment with it. I’d like to learn from it.

I’m learning how to package python with electron or tauri, so I can package some machine learning model for enduser, without letting normal user install technical things.

How do you Bundled python in recourse folder? Can you point out the files, I have trouble reading the codebase, thanks!

In case it has any value, I created an Electron app that packages Python via WebAssembly. It’s BSD licensed and is here: cowasm/desktop/electron at main · sagemathinc/cowasm · GitHub

It a relatively simple proof of concept that provides a python terminal (using xterm.js), but it was actually pretty difficult for me to get working. The Python interpreter runs in the node.js side of Electron (rather than the browser), so that Python has full access to your files (unlike something like JupyterLite).

(I realize this doesn’t answer your question, but thought it might be of interest to somebody.)