关于jupyter notebook无法自动跳转chrome浏览器的处理方法

1、找到anaconda下的anaconda prompt并打开

2、在anaconda prompt里面输入:jupyter notebook --generate-config

回车后会生成一个配置文件jupyter_notebook_config.py,会提示该文件所在的目录,我的在:C:/user/.jupyter下面。

3、找到并打开这个文件,需要在这个文件设置默认浏览器处增加Chrome,找到如下代码(95-99行):

## Specify what command to use to invoke a web browser when opening the notebook.

#  If not specified, the default browser will be determined by the `webbrowser`

#  standard library module, which allows setting of the BROWSER environment

#  variable to override it.

#c.NotebookApp.browser = ''

在下面,增加如下代码:

importwebbrowser

webbrowser.register('chrome',None, webbrowser.GenericBrowser(u'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'))

c.NotebookApp.browser ='chrome'

可能有人会说不知道谷歌浏览器位置啊

将谷歌浏览器发送至桌面快捷方式,然后右键点击属性,没错就是里面‘目标’后面的那一坨啊!

保存,收工。

再次打开jupyter notebook会发现从谷歌浏览器中打开了。

参考文章:https://blog.csdn.net/shuiyuejihua/article/details/78390020?locationNum=10&fps=1

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容