如何更改 jupyter notebook 在 windows 中使用的默认浏览器 [英] How to change the default browser used by jupyter notebook in windows
问题描述
我在一台没有管理员权限的 Windows 机器上,我想在 chrome 上运行 jupyter,而默认浏览器是另一个.
I'm on a windows machine without admin right and I would like to run jupyter on chrome, while the default browser is another.
我在本地安装了 Anaconda 发行版,我启动 jupyter 的第一个选择是通过 Anaconda Navigator,但也许我必须做其他事情.因为它是本地安装,命令行 jupyter notebook
不会产生任何结果.
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.
当我在默认浏览器中粘贴 url 地址时(类似于 http://localhost:8892/notebooks/Home/Exercices/Testing1.ipynb
chrome 页面要求我输入密码或令牌.我没有密码,也不知道令牌是什么.
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.
有没有办法更改 Anaconda Navigator 的浏览器?或者如何使用 Chrome 启动 jupyter?
Is there a way to change the browser of the Anaconda Navigator? or how can I start jupyter with Chrome?
推荐答案
感谢@Darthbith 和这篇文章 如何更改 Linux 中 ipython/jupyter notebook 使用的默认浏览器? 我能想出来出:
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:
步骤 1:从开始菜单打开 Anaconda Prompt 并输入
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
这将生成文件 ~/.jupyter/jupyter_notebook_config.py
(或 jupyter_server_config.py
for nbclassic/new JupyterLab)
This will generate the file ~/.jupyter/jupyter_notebook_config.py
(or jupyter_server_config.py
for nbclassic/new JupyterLab)
第 2 步:编辑此文件并更改以下行(chrome 也在本地安装)
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'
这篇关于如何更改 jupyter notebook 在 windows 中使用的默认浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!