I'm running Jupyter notebooks (Python 3) on a remote cluster that I'm connected/tunneled to over SSH.
Jupyter's default behavior is to try to open the dashboard in a web browser when it launches -- aparently (I only just updated), at some point they switched to the Python 3 webbrowser
library for this.
According to webbrowser
's documentation:
text-mode browsers will be used if graphical browsers are not available or an X11 display isn’t available.
This is exactly what happens. I run jupyter notebook
, webbrowser
launches elinks
, and my one-time authentication token gets eaten, preventing me from connecting to the notebook.
Jupyter isn't configured to use a browser -- c.NotebookApp.browser
is commented out in my config -- and running BROWSER="" jupyter notebook
doesn't help either.
How can I force Jupyter not to open any browser?
Step 1: Run Jupyter Notebook from remote machine Log-in to your remote machine the usual way you do. In most cases, this is simply done via an ssh command. Once the console shows, type the following: remoteuser@remotehost: jupyter notebook --no-browser --port=XXXX # Note: Change XXXX to the port of your choice.
jupyter-notebook --help
includes the following:
--no-browser
Don't open the notebook in a browser after startup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With