如何在 Windows 上的 chrome 中打开 Jupyter 笔记本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46829761/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:58:31  来源:igfitidea点击:

how to open Jupyter notebook in chrome on windows

windowsgoogle-chromejupyter-notebook

提问by steve zissou

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 PC 上,我安装了 anaconda,当我打开 jupyter 笔记本时,它会在 Internet Explorer 中打开,但我想改用 Chrome。有谁知道如何实现这一目标?

回答by Louise Davies

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

如果您还没有,请通过运行创建一个笔记本配置文件

jupyter notebook --generate-config

jupyter notebook --generate-config

Then, edit the file jupyter_notebook_config.pyfound in the .jupyterfolder of your home directory.

然后,编辑在您的主目录jupyter_notebook_config.py.jupyter文件夹中找到的文件。

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

您需要将行更改# c.NotebookApp.browser = ''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.exebut check on your system to be sure.

在 Windows 10 上,应该可以找到 Chrome,C:/Program Files (x86)/Google/Chrome/Application/chrome.exe但请检查您的系统以确保。

回答by jitsbits

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

只需将 chrome 作为默认浏览器并启动 jupyter 。它会工作

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 Settingsand scroll down to Default browser.
  3. Change the value of the default browser to Google Chromeby clicking on whatever your default browser is there and selecting Google Chrome.
  1. 点击自定义和控制谷歌浏览器(谷歌浏览器右上角的垂直三个点)
  2. 单击设置并向下滚动到 默认浏览器
  3. 通过单击默认浏览器所在的任何内容并选择,将默认浏览器的值更改为Google ChromeGoogle Chrome

Note:

笔记:

在 Windows 10 中,您将被重定向到 Default apps您计算机下的默认应用程序Settings设置。请向下滚动至Web browserWeb 浏览器并选择Google Chrome谷歌浏览器。如果提示,请单击OK好的其他只是close关闭设置选项卡并返回到您的commandcommand或像往常一样anaconda promptanaconda prompt键入jupyter notebookjupyter notebook。现在应该在 Google Chrome 中打开一个新的 jupyter notebook 标签。

回答by Ale

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

使用以下步骤创建和编辑 jupyter notebook 配置文件:

  • Launch Anaconda Prompt
  • Type jupyter notebook --generate-config
  • Type notepad path_to_file/jupyter_notebook_config.pyto 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
  • 启动Anaconda 提示
  • 类型 jupyter notebook --generate-config
  • 键入notepad path_to_file/jupyter_notebook_config.py以打开它(更改path_to_file
  • 修改#c.NotebookApp.browser = ''c.NotebookApp.browser = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
  • 保存文件并关闭它

Jupyter notebook will now use Chrome.

Jupyter 笔记本现在将使用 Chrome。

回答by Kenny

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

对于那些仍然无法从 cmd 自动启动 Chrome 的人,请尝试更换

# c.NotebookApp.browser =''

in the file jupyter_notebook_config.pywith

在文件jupyter_notebook_config.py

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.

或适当的位置,不需要通过 pip 安装任何东西。

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

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

回答by Dudi Rendusara

  • Run the jupyter notebook --generate-configcommand on the anaconda prompt.
  • Then edit the jupyter_notebook_config.pyfile.
  • --generate-config在 anaconda 提示符下运行 jupyter notebook命令。
  • 然后编辑jupyter_notebook_config.py文件。

Find the c.NotebookApp.Browser like this:

像这样找到 c.NotebookApp.Browser:

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

Works on mine.

在我的工作。

回答by Mimansa

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

步骤1:转到Windows的搜索菜单并键入默认应用程序。

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

第 2 步:转到 WEB BROWSER 标题并将其更改为 Google Chrome。

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

步骤 3:转到 Windows 的搜索菜单并输入 jupyter notebook

This will open the jupyter notebook in Google Chrome

这将在 Google Chrome 中打开 jupyter notebook

回答by Tejas Kothari

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.

在您的计算机上获取任何 html 文件并设置默认浏览器以将 html 文件打开为 chrome。这将自动打开带有 chrome 的 jupyter notebook。对我来说有效。

回答by Layla Michan Aguirre

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

对于 Windows,设置默认浏览器以将 html 文件打开到 Chrome。配置 > 默认应用程序 > 按文件类型划分的默认应用程序。对我来说有效。

回答by Nan Sun

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.

您无需更改 jupyter 配置代码中的任何内容,只需在设置中将 Chrome 设为默认浏览器即可。Jupyter 打开默认设置。

回答by Rusty_Shackleford

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

- 打开 anaconda prompt 并为 Jupyter 生成配置文件: jupyter notebook --generate-config

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

- 在以下位置打开新创建的配置文件: 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'