Update:
For some, the original answer below should still work.
For others, who get an additional error related to a tcgetpgrp failed: Not a tty
message, there is no real fix at the moment. (See this issue on GitHub)
Therefore, you need to use jupyter notebook --no-browser
or set c.NotebookApp.open_browser = False
in the config file $HOME/.jupyter/jupyter_notebook_config.py
.
Original answer:
I had the problem that Jupyter didn't find a file (complete error message in German):
Start : Dieser Befehl kann aufgrund des folgenden Fehlers nicht ausgeführt werden: Das System kann die angegebene
Datei nicht finden.
In Zeile:1 Zeichen:1
+ Start "file:///home/nico/.local/share/jupyter/runtime/nbserver-1164-o ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Jupyter did work, but it didn't open my browser, when I typed jupyter notebook
.
I found a very simple solution to this:
- Create the Jupyter Config file:
jupyter notebook --generate-config
or
touch $HOME/.jupyter/jupyter_notebook_config.py
- Now add the following line to the config file (by using
nano
or any other text editor):
c.NotebookApp.use_redirect_file = False
Now, my WSL uses the wslview
command to open the default browser in Windows. (I think)
If wslview .
does nothing, you might need to manually install wslu.
Side note:
This solution also works for jupyter lab
, but you have to use
c.LabApp.use_redirect_file = False
in $HOME/.jupyter/jupyter_lab_config.py
.
Or even better c.ServerApp.use_redirect_file = False
in $HOME/.jupyter/jupyter_server_config.py
.