回覆列表
  • 1 # 老劉教你家常菜

    1、win+r 然後輸入jupyter notebook --generate-config


    2、按照上面的路徑找到jupyter_notebook_config.py,用能開啟該檔案的開啟該檔案


    3、查詢,browser,找到如下程式碼:


    ## 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 = u''

    也有可能#c.NotebookApp.browser = u''這句沒有u是這樣#c.NotebookApp.browser = ''


    4、在這句後面加上


    import webbrowser

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

    c.NotebookApp.browser = 'chrome'

    這裡使用的是chrome瀏覽器,推薦使用,如果你使用火狐之類的也可以。


    windows下地址一定是要用\\的不然不對。


    另外如果還是不行可以考錄改一下工作路徑,或者覺得預設路徑很麻煩的也可以改工作路徑


    5、更改工作路徑


    ## Dict of Python modules to load as notebook server extensions.Entry values can

    # be used to enable and disable the loading ofthe extensions. The extensions

    # will be loaded in alphabetical order.

    #c.NotebookApp.nbserver_extensions = {}


    ## The directory to use for notebooks and kernels.

    #c.NotebookApp.notebook_dir = ''


    在這後面加上


    c.NotebookApp.notebook_dir = 'D:\\anaconda\\nootbookwork'


    路徑自己決定就可以,沒有特定要求。

  • 中秋節和大豐收的關聯?
  • 勇往直前奮不顧身文案?