Setting up default browser for Jupyter Notebook (Anaconda) on macOS

Abrar Nasir
2 min readMay 14, 2021
Photo by Lukas Hellebrand on Unsplash

This is a quick and easy step-by-step guide to change the default browser (which is usually set to Safari normally) to open Jupyter Notebook on macOS Big Sur. For this tutorial, let’s choose Google Chrome as our target browser.

Step 1: Open Terminal and run

cd ~/.jupyter/

Step 2: Call

jupyter notebook --generate-config

Step 3: Open the Jupyter Notebook configuration file by running

open jupyter_notebook_config.py

At this point, a large Python file containing all Jupyter Notebook configuration instructions will open up. You can choose to open the file in any text editor.

Step 4: Use the Find command or Command+F shortcut to search for the keyword, browser within the codes, and find the line

#c.NotebookApp.browser = ''

Note that this is not to be looked for in the Terminal, rather in the file opened by the aforementioned Terminal commands.

Step 5: Uncomment the line shown above by removing the number sign, and insert the application path of Google Chrome in your system inside the single quotation marks. This should finally look like (/similar to) this —

Step 6: Save the file. Close the Anaconda Navigator as well as any opened Jupyter Notebook file running in the background.

And you’re done!

--

--

Abrar Nasir
Abrar Nasir

Written by Abrar Nasir

Management consultant with a personal interest in cars, tech and entrepreneurship

Responses (1)