How to change the default browser used by the ipython/jupyter notebook in Linux? How to change the default browser used by the ipython/jupyter notebook in Linux? linux linux

How to change the default browser used by the ipython/jupyter notebook in Linux?


You can create jupyter_notebook_config.py by:

jupyter notebook --generate-config

Then you go to

~/.jupyter/jupyter_notebook_config.py

and change

# c.NotebookApp.browser = ''

to for example:

c.NotebookApp.browser = '/usr/bin/google-chrome %s'

You can choose which ever browser is installed. You'll find the path for example by typing which firefoxDo not forget to delete the #


The accepted answer is great, here is a solution if you want to change it one time:

jupyter-notebook --browser=firefox

Of course you could make a bash wrapper script with this command or create a .desktop file that would let you launch it in your preferred browser every time you use that launcher.

An example wrapper script could look like this:

#!/bin/bashjupyter-notebook --browser=firefox

You could then place it in your PATH, e.g. $HOME/bin/jnbff.sh, so you can easily launch it from any directory by simply typing its name.

Sidenote: the dash in jupyter-notebook allows for tab-completion, the usually recommended way with space (i.e. jupyter notebook) doesn't.


The following worked for me on win10.For firefox:c.NotebookApp.browser = u'c:/Program Files/Mozilla Firefox/firefox.exe %s'

For chromec.NotebookApp.browser = u'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'

note the 1) "" vs "/" 2) the u and %s