Reputation: 2773
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?
Upvotes: 65
Views: 318641
Reputation: 252
On my (somewhat older and outdated) Anaconda installation on Windows 10 using the --browser
option did not work. I could not use Jupyter Lab due to an outdated browser.
So I had to look for an alternative which for me was setting the environment variable BROWSER
pointing to the browser program file. So by performing a
set BROWSER=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
in a command shell (or Powershell with the appropriate command), Jupyter [Lab] afterwards started by using the MS Edge browser, just as wanted. Any other browser can be used by providing the path to it via setting BROWSER
. I've adjusted my batch file accordingly so I can now use Jupyter Lab.
Upvotes: 0
Reputation: 91
I faced the same issue Installed Anaconda in new laptop and when started Jupyter notebook by default it opened in edge, given my default browser is Chrome.
I just change 'default browser' setting to edge and then again switch to chrome. After this trick, Jupyter is opening in chrome.
Upvotes: 0
Reputation: 379
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
Upvotes: 4
Reputation: 1004
Create and edit the jupyter notebook config file with the following steps:
jupyter notebook --generate-config
notepad path_to_file/jupyter_notebook_config.py
to open it (change path_to_file
)#c.NotebookApp.browser = ''
to c.NotebookApp.browser = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
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'
Upvotes: 20
Reputation: 49
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.
Upvotes: 1
Reputation: 361
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
Upvotes: 2
Reputation: 396
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"
1) Open Anaconda and launch your environment in terminal
2) Create config file and open file in notepad
3) Modify line of NotebookApp with chrome and save modification
4) Launch Jupyter
:( ... but it still launches in Mozilla.
Upvotes: 0
Reputation: 111
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
Upvotes: 0
Reputation: 61
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'
Upvotes: 5
Reputation: 71
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.
Upvotes: 7
Reputation: 51
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.
Upvotes: 5
Reputation: 101
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
Upvotes: 10
Reputation: 15981
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.
Upvotes: 88
Reputation: 71
For windows set the default browser to open html files to Chrome. Configuration > Default Apps > Default Apps by File Type. Worked for me.
Upvotes: 7
Reputation: 391
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.
Upvotes: 29
Reputation: 95
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.
Upvotes: 7
Reputation: 448
Just make chrome as a default browser and launch the jupyter . It will work
To Make Google chrome a default browser , follow steps
Google Chrome
.command
or anaconda prompt
and type jupyter notebook
as usual. A new jupyter notebook tab should open in Google Chrome now.
Upvotes: 34
Reputation: 91
--generate-config
command on the anaconda prompt. 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.
Upvotes: 9