Issue with Starting Jupyter Notebook from WSL


I am hoping someone can help me resolve the following issue. I’d like to be able to start Jupyter from the Windows terminal. I am currently using Windows Subsystem for Linux 1 (WSL1) running Ubuntu. I have a python (version 3.9.5) environment created using conda that includes jupyter version 1.0.0.

Initially when I tried to run jupyter notebook I would get the following error.

tcgetpgrp failed: Not a tty

I followed the recommendation in this discussion and added export BROWSER=/mnt/c/path/to/windows/browser to my .bashrc. That fixed the tcgetpgrp issue. Also if it matters, I am using Firefox.

The issue is that now when I do jupyter notebook Firefox does open a new tab but it is a black screen. The address is file:///home/USERNAME/.local/share/jupyter/runtime/nbserver-23388-open.html. A “workaround” (described here) is to copy/paste http://localhost:8888 into the address bar which then takes me to a jupyter notebook login page where I copy/paste the token so that I can log into the notebook. I can then open and run my notebook file in my browser (so no more black screen). But this process is cumbersome. I am hoping someone can help me find a better way.

Any suggestions or advice would be appreciated.

If you are using Ubuntu WSL, install the wslu package with apt “apt install wslu”. After installing the package, restart the shell and run jupyter again.

1 Like

That’s awesome, did not know this even existed.

Just to clarify though - this is intended for use with Windows Subsystem for Linux 1 (WSL1)? (the docs only mention WSL without a number and WSL2, sorry for being so explicit).

1 Like

I haven’t tried it in WSL1. It works fine in WSL2.