Assign different port number manually when you start the notebook. For example:
jupyter notebook --port=8889
try:
jupyter notebook --no-browserUpdate:
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]:
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:
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]:
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.
I had similar issue with browser, I got
No web browser found: could not locate runnable browser.I installed WSLU //github.com/wslutilities/wslu. Then I got
Start : This command cannot be run due to the error: The system cannot find the file specified. At line:1 char:1 + Start --h + ~~~~~~~~~ + CategoryInfo : InvalidOperation: [:] [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommandjupyter-notebook does not supply url as a parameter to wlsview. It passes a path with file to browser. eg
with actual url
Opening Jupyter NotebookThis page should redirect you to Jupyter Notebook. If it doesn't, click here to go to Jupyter.
Create a file jupyter-notebook-browser with a content to extract actual url
#!/bin/bash file=$[echo "$1" | sed 's/file:\/\///'] url=$[grep -oP 'href="\K[[^"]*localhost[^"]+]' "$file"] wslview "$url"then run jupyter-notebook --browser=jupyter-notebook-browser
or define BROWSER variable and run
export BROWSER="jupyter-notebook-browser" jupyter-notebookWhy does Start-Process fail to find the executable [not in the path] if -RedirectStandardOutput or -RedirectStandardError are specified?
I.e.
The program starts & executes as it should. But when I add output redirection, everything falls apart:
[X:\] Start-Process -FilePath "prog.exe" -WorkingDirectory [Get-Location].Path -RedirectStandardOutput stdout.txt Start-Process: This command cannot be run due to the error: The system cannot find the file specified.Redirecting with the 1>stdout.txt operator works as expected.
This seems not to affect programs that reside in directories listed in PATH. I cannot really figure out what's the logic here. Redirections should have nothing to do with resolving the binary path in the first place.
Running on Windows 10 Professional.
Update: Full trace & simple reproducer
PS> cat .\hello.c #include int main[int argc, char** argv] { printf["Meh\n"]; getchar[]; return 0; } PS> cl hello.c Microsoft [R] C/C++ Optimizing Compiler Version 19.29.30138 for x86 Copyright [C] Microsoft Corporation. All rights reserved. hello.c Microsoft [R] Incremental Linker Version 14.29.30138.0 Copyright [C] Microsoft Corporation. All rights reserved. /out:hello.exe hello.obj PS> Start-Process -FilePath hello.exe -WorkingDirectory [Get-Location].Path PS> Start-Process -FilePath hello.exe -WorkingDirectory [Get-Location].Path -RedirectStandardOutput stdout.txt Start-Process : This command cannot be run due to the error: The system cannot find the file specified. At line:1 char:1 + Start-Process -FilePath hello.exe -WorkingDirectory [Get-Location].Pa ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: [:] [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommandUpdate 2:
Seems that using absolute path for the executable is a workaround for the issue. [Although it doesn't explain why output direction breaks the executable name/path resolution in the first place]