解決問題: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