how to open Jupyter notebook in chrome on windows
WindowsGoogle ChromeJupyter NotebookWindows Problem Overview
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?
Windows Solutions
Solution 1 - Windows
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.
Solution 2 - Windows
Just make chrome as a default browser and launch the jupyter . It will work
To Make Google chrome a default browser , follow steps
- Click on Customize and Control Google chrome (The vertical three dots on the Upper right corner of your google chrome browser)
- Click on Settings and scroll down to Default browser.
- Change the value of the default browser to Google Chrome by clicking on whatever your default browser is there and selecting
Google Chrome
.
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 Note:
command
or anaconda prompt
and type jupyter notebook
as usual. A new jupyter notebook tab should open in Google Chrome now.
Solution 3 - Windows
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.
Solution 4 - Windows
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 (changepath_to_file
) - Modify
#c.NotebookApp.browser = ''
toc.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'
Solution 5 - Windows
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
Solution 6 - Windows
- 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.
Solution 7 - Windows
For windows set the default browser to open html files to Chrome. Configuration > Default Apps > Default Apps by File Type. Worked for me.
Solution 8 - Windows
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.
Solution 9 - Windows
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.
Solution 10 - Windows
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.
Solution 11 - Windows
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'
Solution 12 - Windows
I just followed 2 steps and everythings working as expected
step-1 set chrome executable path environment varibale, in my case it is(you can test it in cmd by typing chrome and enter, it will open your chrome browser if path set properly):-
C:\Program Files\Google\Chrome\Application\chrome.exe
step-2 just run below command and you are good to go
jupyter notebook --browser chrome
Solution 13 - Windows
See response on this thread that has worked for me:
https://stackoverflow.com/a/62275293/11141700
NOTE - Additional STEP 3 that has made the difference for me compared to similar approaches suggested here
In short:
Step 1 - Generate config for Jupyter Notebook:
jupyter notebook --generate-config
Step 2 - Edit the config file using "nano" or other editor
The config fileshould be under your home directory under ".jupyter" folder:
~/.jupyter/jupyter_notebook_config.py
Step 3 - Disable launching browser by redirecting file
First comment out the line, then change True to False:
c.NotebookApp.use_redirect_file = False
Step 4 - add a line to your .bashrc file to set the BROWSER path
export BROWSER='/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
For me it was Chrome under my Windows Program File. Otherwise any linux installation under WSL doesn't have a native browser to launch, so need to set it to the Windows executable.
Step 5 - restart .bashrc
source .bashrc
Solution 14 - Windows
In the windows when we open jupyter notebook in command prompt we can see the instructions in first 10 lines in that there is one instruction- "to open notebook, open this file in browser file://C:/Users/{username}/appdata/roaming/jupyetr/runtime/nbserver-xywz-open.html " , open this html with browser of your choice.
Solution 15 - Windows
This dint work for me. So instead I opened the same link (python file from internet explorer)in chrome and it asked me for a password . I set the password in anaconda prompt using the command : $jupyter notebook password
Solution 16 - Windows
I just set chrome as my default browser and jupyter launches in Chrome now.
However, we have also the following approach, but it did not work for me:
"CONDA version 4.7.5 and jupyter 6.0.0. - Windows 10"
- Open Anaconda and launch your environment in terminal
- Create config file and open file in notepad
- Modify line of NotebookApp with chrome and save modification
- Launch Jupyter
:( ... but it still launches in Mozilla.
Solution 17 - Windows
If you tried all these "solutions" and still doesn't work, try to open the url over HTTP (not HTTPS <-- the real problem with chrome) and using an Incognito window (press Ctrl + Shift + N on Chrome)
This worked for me. Hope it helps