python运行卡死_快速解决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 修改默認目錄并去掉注釋保存,最好修改目錄到非C盤 c.NotebookApp.notebook_dir = 'E:\\Program Files\Python3_6_6\jupyter'(大約246行,注意磁盤名后面是雙斜線)
jupyter notebook啟動服務(wù)器,正常運行
補充知識:jupyter notebook 瀏覽器打開空白卡死情況
jupyter notebook 需要用谷歌瀏覽器打開才可以,其他的瀏覽器打開后多半是空白的。添加默認瀏覽器如下:
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)容了,希望能給大家一個參考,也希望大家多多支持我們。
本文標題: 快速解決jupyter啟動卡死的問題
本文地址: http://www.cppcns.com/jiaoben/python/306836.html
總結(jié)
以上是生活随笔為你收集整理的python运行卡死_快速解决jupyter启动卡死的问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 模块就是一个普通的python程序文件_
- 下一篇: python调用命令行获取pid_pyt