Jupyter Notebook跳转浏览器后页面问题

最近,原本正常使用的jupyter notebook,不知道怎么回事,在cmd里启动后,可以跳转浏览器,但打不开页面。显示ERR_FILE_NOT_FOUND。

经过和别的正常电脑对比,发现jupyter notebook在启动时会在runtime文件夹里创建一个json文件和html文件,但是现在不知道什么原因没有创建,所以找不到这个html页面,浏览器显示错误。

runtime文件夹里是空的
runtime文件夹里是空的

在网上查了好久,也没找到类似问题和解决办法。后来想起在jupyter notebook_config.py里查看下这个runtime文件夹的位置是不是配置错误,经过ctrl+f查找后发现了踪迹。

发现里面有这么一段描述:

## Disable launching browser by redirect file
#  
#          For versions of notebook > 5.7.2, a security feature measure was added that
#          prevented the authentication token used to launch the browser from being visible.
#          This feature makes it difficult for other users on a multi-user system from
#          running code in your Jupyter session as you.
#  
#          However, some environments (like Windows Subsystem for Linux (WSL) and Chromebooks),
#          launching a browser using a redirect file can lead the browser failing to load.
#          This is because of the difference in file structures/paths between the runtime and
#          the browser.
#  
#          Disabling this setting to False will disable this behavior, allowing the browser
#          to launch by using a URL and visible token (as before).
#  Default: True
# c.NotebookApp.use_redirect_file = True

 大体意思是浏览器环境问题会导致不能跳转。下面也给出了解决办法。

# c.NotebookApp.use_redirect_file = True注释取消掉,并设为False,使用URL直接跳转。

c.NotebookApp.use_redirect_file = False

完美解决问题!!!

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值