解决问题:Jupyter Notebook启动不会自动打开浏览器,每次都要自己打开浏览器输入网址


1、找到anaconda下的anaconda prompt并打开(或者CMD)都可以

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

回车后会生成一个配置文件jupyter_notebook_config.py,会提示该文件所在的目录。

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'


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM