快速解决jupyter启动卡死的问题
问题描述
系统:Win10;之前安装过Cpython,现在依次使用pipinstallipython与pipinstalljupyter安装了Ipython6.5.0与jupyter1.0.0。但是在PowerShell上使用命令jupyternotebook运行jupyter时服务器始终卡顿,根本没法用。
解决方法
使用命令jupyternotebook--generate-config可看到文件jupyter_notebook_config.py位置
手动打开文件进行编辑,找到c.NotebookApp.notebook_dir修改默认目录并去掉注释保存,最好修改目录到非C盘c.NotebookApp.notebook_dir='E:\\ProgramFiles\Python3_6_6\jupyter'(大约246行,注意磁盘名后面是双斜线)
jupyternotebook启动服务器,正常运行
补充知识:jupyternotebook浏览器打开空白卡死情况
jupyternotebook需要用谷歌浏览器打开才可以,其他的浏览器打开后多半是空白的。添加默认浏览器如下:
1.在anacondaprompt里面直接输入或cmd中输入(前提是已经将anaconda加入环境变量):
jupyternotebook--generate-config
让jupyter生成一个配置文件,生成后你会看到文件地址的,如图所示:
C:\Users\Administrator\.jupyter\jupyter_notebook_config.py
2.然后就可以使用记事本之类的,打开这个jupyter_notebook_config.py文件
然后查找,browser,找到如下代码:
##Specifywhatcommandtousetoinvokeawebbrowserwhenopeningthenotebook. #Ifnotspecified,thedefaultbrowserwillbedeterminedbythe`webbrowser` #standardlibrarymodule,whichallowssettingoftheBROWSERenvironment #variabletooverrideit. #c.NotebookApp.browser=u''
在这个后面,添加如下代码(google浏览器):
##Specifywhatcommandtousetoinvokeawebbrowserwhenopeningthenotebook. #Ifnotspecified,thedefaultbrowserwillbedeterminedbythe`webbrowser` #standardlibrarymodule,whichallowssettingoftheBROWSERenvironment #variabletooverrideit. #c.NotebookApp.browser='' importwebbrowser webbrowser.register('chrome',None,webbrowser.GenericBrowser(u'C:\ProgramFiles(x86)\Google\Chrome\Application\chrome.exe')) c.NotebookApp.browser='chrome'
以上这篇快速解决jupyter启动卡死的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。