Monday, October 30, 2017

Changing Jupyter configuration

If one wants to open Jupyter notebook on a different browser than it can be done by couple of ways outlined below

The first step is to generate the config file

jupyter notebook --generate-config

This generates the config file in home directory at home directory



Writing default config to: <home_directory>/.jupyter/jupyter_notebook_config.py

Open the file and search for c.NotebookApp.browser

You will see an entry as follows

## Specify what command to use to invoke a web browser when opening the notebook.
#  If not specified, the default browser will be determined by the `webbrowser`
#  standard library module, which allows setting of the BROWSER environment
#  variable to override it.

#c.NotebookApp.browser = u''

Replace that with the location of the browser. For example replacing with chrome path. Also uncomment the line

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

The notebook can also be changed on a different browser at runtime using the --browser switch

jupyter notebook --browser /usr/bin/google-chrome

One more way is to cut and paste the url on the intended browser which comes on command line when jupyter is started

jupyter notebook

In the console you will see a line as follows
 
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=489ee76a8d793fb38bc3b2d0c44ec586ff06b7afd97d655f


No comments:

Post a Comment