Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to open Jupyter notebook in chrome on windows

On my Windows PC, i have anaconda installed and when I open a jupyter notebook, it opens up in internet explorer, but I would like to use Chrome instead. Does anyone know how to achieve this?

like image 327
steve zissou Avatar asked Oct 19 '17 12:10

steve zissou


People also ask

How do I open a jupyter notebook in Windows?

To launch Jupyter Notebook App: Click on spotlight, type terminal to open a terminal window. Enter the startup folder by typing cd /some_folder_name . Type jupyter notebook to launch the Jupyter Notebook App The notebook interface will appear in a new browser window or tab.

How do I open a jupyter notebook in browser?

Windows File Explorer + Command Prompt Once you've entered your specific folder with Windows Explorer, you can simply press ALT + D, type in cmd and press Enter. You can then type jupyter notebook to launch Jupyter Notebook within that specific folder.

Can I use jupyter notebook in browser?

With this Jupyter lab distribution, you do not need to run jupyter notebook command in your terminal anymore to launch your notebook. It completely runs on a web browser, without having any dependency of installations on the end user device.


11 Answers

If you haven't already, create a notebook config file by running

jupyter notebook --generate-config

Then, edit the file jupyter_notebook_config.py found in the .jupyter folder of your home directory.

You need to change the line # c.NotebookApp.browser = '' to c.NotebookApp.browser = 'C:/path/to/your/chrome.exe %s'

On windows 10, Chrome should be located C:/Program Files (x86)/Google/Chrome/Application/chrome.exe but check on your system to be sure.

like image 130
Louise Davies Avatar answered Sep 25 '22 03:09

Louise Davies


Just make chrome as a default browser and launch the jupyter . It will work

To Make Google chrome a default browser , follow steps

  1. Click on Customize and Control Google chrome (The vertical three dots on the Upper right corner of your google chrome browser)
  2. Click on Settings and scroll down to Default browser.
  3. Change the value of the default browser to Google Chrome by clicking on whatever your default browser is there and selecting Google Chrome.

Note:

In windows 10, you will be redirected to Default apps under your computer's Settings. Please scroll down to Web browser and Select Google Chrome. If promted, Click on OK else just close the settings tab and return to your command or anaconda prompt and type jupyter notebook as usual. A new jupyter notebook tab should open in Google Chrome now.
like image 45
jitsbits Avatar answered Sep 25 '22 03:09

jitsbits


For those who still have trouble launching Chrome automatically from cmd, try replacing

# c.NotebookApp.browser =''

in the file jupyter_notebook_config.py with

import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'))
c.NotebookApp.browser = 'chrome'

or the appropriate location, there shouldn't be need to install anything via pip.

Ref: https://support.anaconda.com/customer/en/portal/articles/2925919-change-default-browser-in-jupyter-notebook

like image 36
Kenny Avatar answered Sep 24 '22 03:09

Kenny


Create and edit the jupyter notebook config file with the following steps:

  • Launch Anaconda Prompt
  • Type jupyter notebook --generate-config
  • Type notepad path_to_file/jupyter_notebook_config.py to open it (change path_to_file)
  • Modify #c.NotebookApp.browser = '' to c.NotebookApp.browser = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
  • Save the file and close it

Jupyter notebook will now use Chrome.

EDIT

In Windows 10 I had to type

  • notepad .jupyter/jupyter_notebook_config.py

And substitute the line with

  • c.NotebookApp.browser = 'C:/Program Files/Google/Chrome/Application/chrome.exe %s'
like image 27
Ale Avatar answered Sep 26 '22 03:09

Ale


step1: Go to search menu of windows and type default app.

step 2: go to WEB BROWSER title and change it to Google Chrome.

step3: Go to search menu of windows and type jupyter notebook

This will open the jupyter notebook in Google Chrome

like image 39
Mimansa Avatar answered Sep 23 '22 03:09

Mimansa


Take any html file on your computer and set the default browser to open html files to chrome. This will automatically open jupyter notebook with chrome. Worked for me.

like image 31
Tejas Kothari Avatar answered Sep 22 '22 03:09

Tejas Kothari


I found an easier solution that may help beginners to coding.

go to

C:\Users\'-your user-'\AppData\Roaming\jupyter\runtime

and find a file named

nbserver-6176-open.html

then

Right-click > open with > Choose default program...

Here, what ever you choose would be saved on your Windows to open all HTML files; therefore when you run Jupyter notebook, it would open in the program you want.

like image 39
Maz Avatar answered Sep 26 '22 03:09

Maz


  • Run the jupyter notebook --generate-config command on the anaconda prompt.
  • Then edit the jupyter_notebook_config.py file.

Find the c.NotebookApp.Browser like this:

c.NotebookApp.browser = 'c:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'

Works on mine.

like image 30
Dudi Rendusara Avatar answered Sep 22 '22 03:09

Dudi Rendusara


For windows set the default browser to open html files to Chrome. Configuration > Default Apps > Default Apps by File Type. Worked for me.

like image 31
Layla Michan Aguirre Avatar answered Sep 22 '22 03:09

Layla Michan Aguirre


You don't have to change anything in the jupyter config code, you just have to make Chrome as your default browser in the setting. Jupyter opens whichever is the default.

like image 38
Nan Sun Avatar answered Sep 25 '22 03:09

Nan Sun


For some reason Louise's answer didn't work for me I had to:

-Open anaconda prompt and generate the config file for Jupyter: jupyter notebook --generate-config

-Open the newly created config file at: C:\Users\builder\.juptyer\jupyter_notebook_config.py

-Add the following to the file:

import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser(r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'))
c.NotebookApp.browser = 'chrome'
like image 24
Rich_Foley Avatar answered Sep 22 '22 03:09

Rich_Foley