Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Jupyter Notebook *not* to open a web browser

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?

like image 254
Linuxios Avatar asked Sep 06 '18 19:09

Linuxios


People also ask

How do you start Jupyter notebook server without opening a Web 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.


1 Answers

jupyter-notebook --help includes the following:

--no-browser
    Don't open the notebook in a browser after startup.
like image 172
user2357112 supports Monica Avatar answered Oct 17 '22 01:10

user2357112 supports Monica