Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

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

I'm on a windows machine without admin right and I would like to run jupyter on chrome, while the default browser is another.

I have a local installation of the Anaconda distribution and my first option to start jupyter would be through the Anaconda Navigator, but maybe I have to do something else. Because it is a local installation the command line jupyter notebook produces no results.

When I paste the url address in the default browser I have (something like http://localhost:8892/notebooks/Home/Exercices/Testing1.ipynb the chrome page asks me for a password or token. I have no password and I do not know what a token is.

Is there a way to change the browser of the Anaconda Navigator? or how can I start jupyter with Chrome?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Thanks to @Darthbith and this post How to change the default browser used by the ipython/jupyter notebook in Linux? I was able to figure it out:

Step 1: To open Anaconda Prompt from the Start Menu and type

# for old notebook and JupyterLab < 3.0, or
jupyter notebook --generate-config
# for new nbclassic and JupyterLab >= 3.0
jupyter server --generate-config

This will generate the file ~/.jupyter/jupyter_notebook_config.py (or jupyter_server_config.py for nbclassic/new JupyterLab)

Step 2: Edit this file and change the following line (chrome is also is also in a local installation)

# for old notebook and JupyterLab < 3.0
c.NotebookApp.browser = u'C:/Home/AppData/Local/Google/Chrome/Application/chrome.exe %s'
# OR for new nbclassic and JupyterLab >= 3.0
c.ServerApp.browser = u'C:/Home/AppData/Local/Google/Chrome/Application/chrome.exe %s'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...