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

后端 未结 19 2297
盖世英雄少女心
盖世英雄少女心 2020-12-04 10:17

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 Ana

相关标签:
19条回答
  • 2020-12-04 11:02

    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

    jupyter notebook --generate-config
    

    This will generate the file ~/.jupyter/jupyter_notebook_config.py

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

    c.NotebookApp.browser = u'C:/Home/AppData/Local/Google/Chrome/Application/chrome.exe %s'
    
    0 讨论(0)
  • 2020-12-04 11:03

    I don't know the precise details for Windows, but this is how to set the default browser on a Mac:

    jupyter notebook --generate-config
    

    This creates a file jupyter_notebook_config.py in ~/.jupyter. Edit the line

    #c.NotebookApp.browser = ''
    

    On a Mac I set it to:

    c.NotebookApp.browser = u'/Applications/Gooogle\ Chrome.app %s'
    

    You just need to figure out how to point it to Chrome on Windows.

    0 讨论(0)
  • 2020-12-04 11:03

    Is there any way to run jupyter on chrome in /tmp ?

    something like that:

    jupyter notebook --browser='google-chrome --user-data-dir=/tmp/'
    
    0 讨论(0)
  • 2020-12-04 11:04

    The explanations above didn't work for me, I guess, I mistyped something. Actually it was easier for me to change default browser to Chrome and then Jupiter automatically starts in Chrome after next launch. (Search Windows - change default browser).

    0 讨论(0)
  • 2020-12-04 11:06

    Make sure to activate the line by removing the # comment indicator.

    0 讨论(0)
  • As far as I know, there's no way to change the default browser that opens. However, you can find the token for the Notebook server by opening Anaconda Prompt from the Start Menu and typing

    jupyter notebook list
    

    This will give you a URL with the token that you can copy/paste into any other browser. The output of the list command looks like

    Currently running servers:
    http://localhost:8888/?token=41429d3dcf554d0dde69498aac0950654a590664ba02b3cd :: /path/to/home/folder
    

    So you can either type http://localhost:8888 into the browser and then copy/paste the token into the field, or just copy/paste the whole URL with the token.

    0 讨论(0)
提交回复
热议问题