天天看點

親測成功!jupyter notebook 安裝後更改預設打開目錄和浏覽器

在cmd裡輸入

jupyter notebook --generate-config
           

在路徑 C:\Users\xxxxx\.jupyter 下找到jupyter_notebook_config.py檔案,用文本文檔或Notepad++打開

1、更改預設打開目錄

搜尋'  c.NotebookApp.notebook_dir  '

将本行的“#”去掉,并在後面的單引号中添加你想設定的目錄
           

2、更改浏覽器

搜尋‘  c.NotebookApp.browser  ’,在下面增加以下語句:

import webbrowser
webbrowser.register(
    "Firefox",  #自定義名字
    None, 
    webbrowser.GenericBrowser(u"D:\\Program Files\\Firefox\\firefox.exe"))#指定程式所在位置
c.NotebookApp.browser = "Firefox"
           

重新進入軟體!!!

這樣設定的浏覽器是可以自動打開的!!!

繼續閱讀