Skip to content

Instantly share code, notes, and snippets.

@data-enhanced
Last active December 18, 2020 13:23
Show Gist options
  • Save data-enhanced/a9e286646dec2bb65ac8b524a331c86d to your computer and use it in GitHub Desktop.
Save data-enhanced/a9e286646dec2bb65ac8b524a331c86d to your computer and use it in GitHub Desktop.
Change default browser for Jupyter Notebooks in Mac OS X

Change the Default Browser for Jupyter Notebooks in OS X

Step 1. Create an editable config file for Jupyter notebooks.

To do this, open Terminal and type:

jupyter notebook --generate-config

This generates the file:

~/.jupyter/jupyter_notebook_config.py

Step 2. Open and edit the new config file.

Find the block for # import webbrowser.

Remove the hash mark for the next line c.NotebookApp.browser = ''

Update the line by supplying the open command and correct path for your desired browser.

For Firefox:

# import webbrowser
c.NotebookApp.browser = u'open -a /Applications/Firefox.app %s'

For Google Chrome:

# import webbrowser
c.NotebookApp.browser = u'open -a /Applications/Google\ Chrome.app %s'

Save the new file. Reopen jupyter notebooks.

References

Launch Jupyter Notebook in Safari from Anaconda Navigator? Stackoverflow.com

How to change the default browser used by jupyter notebook in windows

@Jibril14
Copy link

Jibril14 commented Sep 17, 2020

In the updated version of jupyter notebook, the preferred/default brouser on your PC is automatically used to load your note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment