快速解決jupyter啟動卡死的問題
問題描述
系統(tǒng):Win10;之前安裝過Cpython,現(xiàn)在依次使用pip install ipython與pip install jupyter安裝了 Ipython 6.5.0與 jupyter 1.0.0。但是在PowerShell上使用命令jupyter notebook 運行jupyter時服務(wù)器始終卡頓,根本沒法用。
解決方法
使用命令jupyter notebook --generate-config 可看到文件 jupyter_notebook_config.py位置
手動打開文件進行編輯,找到c.NotebookApp.notebook_dir 修改默認(rèn)目錄并去掉注釋保存,最好修改目錄到非C盤 c.NotebookApp.notebook_dir = 'E:\\Program Files\Python3_6_6\jupyter'(大約246行,注意磁盤名后面是雙斜線)
jupyter notebook啟動服務(wù)器,正常運行
補充知識:jupyter notebook 瀏覽器打開空白卡死情況
jupyter notebook 需要用谷歌瀏覽器打開才可以,其他的瀏覽器打開后多半是空白的。添加默認(rèn)瀏覽器如下:
1.在anaconda prompt 里面直接輸入或cmd中輸入(前提是已經(jīng)將anaconda加入環(huán)境變量):
jupyter notebook --generate-config
讓jupyter生成一個配置文件,生成后你會看到文件地址的,如圖所示:
C:\Users\Administrator\.jupyter\jupyter_notebook_config.py
2.然后就可以使用記事本之類的,打開這個jupyter_notebook_config.py文件
然后查找,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''
在這個后面,添加如下代碼(google瀏覽器):
## 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 = '' import webbrowser webbrowser.register('chrome', None, webbrowser.GenericBrowser(u'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe')) c.NotebookApp.browser = 'chrome'
以上這篇快速解決jupyter啟動卡死的問題就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
解決python3讀取Python2存儲的pickle文件問題
今天小編就為大家分享一篇解決python3讀取Python2存儲的pickle文件問題,具有很好的參考價值。希望對大家有所幫助。一起跟隨小編過來看看吧2018-10-10python reverse反轉(zhuǎn)部分?jǐn)?shù)組的實例
今天小編就為大家分享一篇python reverse反轉(zhuǎn)部分?jǐn)?shù)組的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-12-12關(guān)于Python3的import問題(pycharm可以運行命令行import錯誤)
這篇文章主要介紹了關(guān)于Python3的import問題(pycharm可以運行命令行import錯誤),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-11-11