jupyter notebook 的默认起始位置和默认浏览器修改

发布时间 2023-11-11 06:52:43作者: 一叶菩提一粒尘

打不开浏览器/时间很久的解决办法:

    当第一次点luanch的时候会出现无法弹出浏览器的情况,需要打开目录C:\Users\Administrator\.jupyter
    也可以通过如下命令查找
    (base) C:\Users\Administrator><font color=red size=6>jupyter notebook --generate-config</font>
    Writing default config to: C:\Users\Administrator\.jupyter\jupyter_notebook_config.py

    并修改jupyter_notebook_config.py在文末添加如下内容:

    import webbrowser
    webbrowser.register('chrome',None, webbrowser.GenericBrowser(u'C:\Program Files\Google\Chrome\Application\chrome.exe'))
    c.NotebookApp.browser ='chrome'
    c.NotebookApp.notebook_dir = 'F:\jupyter'