Closed bluss closed 2 days ago
This looks like the same error message as in #847, although that issue mentions Windows 10 and doesn't mention Rye.
Out of curiosity, if you're not using Rye, do you see the same "Jupyter server process terminated before the initialization completed" error? If so, this might effectively be a duplicate of #847.
It's a very generic error message, I'm not surprised if separate problems can lead to the same place.
If I don't use rye I don't have the problem.
When this happens I can grab the launch script from the log - something like /tmp/jlab_desktopfiS6Bd/launch.sh - and that script starts jupyterlab correctly when I run it separately. So that's mysterious.
From the log:
[2024-07-30 19:17:39.523] [error] Failed to start server Error: Jupyter Server process terminated before the initialization completed
at ChildProcess.<anonymous> (/opt/JupyterLab/resources/app.asar/build/out/main/server.js:295:28)
at ChildProcess.emit (node:events:514:28)
at Process.onexit (node:internal/child_process:291:12)
I can see now later that the source "/home/ulrik/.rye/bin/activate"
is a red herring. (or maybe not?) but even cases that work print commands like source "/usr/bin/activate" - another path that doesn't usually exist. (Which by the way is a correctness or even safety hazard - one can't just rely on that path not existing. It could be something that wrecks the execution.)
It looks like there's an issue concerning using Rye shims with JupyterLab, among other projects: https://github.com/astral-sh/rye/issues/1093
I'll keep this issue open to track it from Jupyter's perspective, but there might need to be some work done in Rye to prevent errors like this one.
I'll abandon this bug as uv has taken over all rye's features, and I do not use rye anymore.
Description
In some Rye-using setups:
Reproduce
Expected behavior
jlab notebookfile.ipynb should maybe use the same selected virtual environment "V" that the user interface otherwise defaulted to.
jlab should not try to launch ~/.rye/bin/python as if it is a virtual environment, because it's not (it's a shim for a system interpreter).
Context
The following appeared in the debug log, and this obviously fails, because that activate script does not exist:
This is quite suspicious - the "system python path" is "$HOME/.rye/bin/python" and jlab is treating that as if it's a .venv (it's not, that shim will reexecute to /usr/bin/python which is python 3.10)
Troubleshoot Output
Browser Output (required for interface issues after loading)
Logs (required for issues with loading, server and startup)
Suggested Workaround
Make sure jupyter is not installed in any system interpreter's user site.
Thanks for the nice work on jupyterlab desktop :)