Skip to content

[Windows] Jupyter lab desktop, "Failed to create session!" "Error: Failed to launch Jupyter Server" #882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nerickson-debug opened this issue Jan 13, 2025 · 3 comments
Labels

Comments

@nerickson-debug
Copy link

nerickson-debug commented Jan 13, 2025

Description

Hello! I'm having trouble running the Jupyter app for Desktop. I've installed the windows version fine, running the install both as admin and normally, and in either case when I try to create a session it thinks for a bit and then gives "Failed to create session!" "Error: Failed to launch Jupyter Server".

image

I've look at issues 381 and 238 and the installation troubleshooting guide (links below), but to be honest I'm not super good at environments/paths. I'm definitely your basic end user. It's quite possible this is a very basic path issue and it's not looking for python/conda in the right place. If so, direction on how to find and point to the right paths would be awesome.

Similar bug reports:

#381
#238
https://discourse.jupyter.org/t/how-to-solve-jupyter-server-initialization-failed/12469

Expected behavior

I would like the Jupyter desktop app to create sessions/function normally.

Context

Operating system: Windows 11 Pro x64
JupyterLab Desktop version: 4.2.5-1
Using conda 24.11.3
python in conda version: 3.9.21
Installer: https://github.com/jupyterlab/jupyterlab-desktop windows x64 installer
Jupyter Desktop launched via clicking its icon from start menu
Jupyter web app works fine (launched via conda prompt, "Jupyter lab" command)
Jupyter desktop seems to recognize running web app sessions (via the 'connect' button on desktop app)

It's quite possible this is a very basic path issue and it's not looking for python/conda in the right place. If so, direction on how to find and point to the right paths would be awesome.

I notice I get different path behavior (paths in the Manage Python environments 'Settings' tab are different) if I run Jupter Desktop as admin vs normally (but each case gives the same error).

I get the same error whether I use the bundled environment or the custom python environment toggle (in the Manage Python environments 'Settings' tab).

I have tried changing the python path to the result of the 'where python' command in an anaconda prompt, which returns
(
C:\Users\nerickson\Anaconda3\python.exe
C:\Users\nerickson\AppData\Local\Microsoft\WindowsApps\python.exe
)

The top line (C:\Users\nerickson\Anaconda3\python.exe) resulted in a blue check, while the bottom gave a red x. Neither fixed the error.

I've also simultaneously changed the conda path to the result of the 'where conda' command in an anaconda prompt (C:\Users\nerickson\Anaconda3\Scripts\anaconda.exe). However, this still gave a red check and did not fix the error.

Here is the log file generated by using jlab --log-level debug in a conda prompt. I then first tried to start a new session with 'custom', and tried a second time with 'bundled', for the following path settings (see image):

... of course the fact that the conda path is a red x is an obvious red flag, but seeing as that location is what results when I run 'where conda', I didn't understand why it wasn't valid or what to replace it with. So please do let me know if that's root cause and if so how to proceed!

Log: main.log
image

Thank y'all so much!

@RRosio
Copy link

RRosio commented Jan 14, 2025

Thank you for opening this issue @nerickson-debug! From triage, could you try launching the server manually to see if you encounter any issues?

@krassowski
Copy link
Member

could you try launching the server manually

You could do this by running:

python -m jupyterlab --no-browser --expose-app-in-browser

In the anaconda3 virtual environment that you were trying to use

@nerickson-debug
Copy link
Author

nerickson-debug commented Jan 14, 2025

Howdy! Thanks for the replies!

I ran the code snippet you provided, then pasted the generated filename into firefox and it opened/ran just fine. (It looks like a normal jupyter lab web instance, but I suppose that's the point!). And just as a sanity check, the jupyter lab desktop app still didn't work after that.

Also, just to say it out loud, thank you Rosio for the tip and Michal for the followup clarifying comment, as my next question would totally have been "uhh, how do I do that?" haha.

@andrii-i andrii-i changed the title Jupyter lab desktop, "Failed to create session!" "Error: Failed to launch Jupyter Server" [Windows] Jupyter lab desktop, "Failed to create session!" "Error: Failed to launch Jupyter Server" Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants