【问题标题】:Blank ipython notebook in jupyterjupyter中的空白ipython笔记本
【发布时间】:2016-01-28 15:44:34
【问题描述】:

首先,导航键(箭头、home、end...)在我的 ipython 笔记本(Ubuntu 14.04,firefox 和 chromium 中)中停止工作,然后我按照 安装 Jupyter(我已经在http://jupyter.readthedocs.org/en/latest/install.html 中拥有 Python) 期望升级可以解决问题,但是现在当我尝试创建一个新的 Python2 笔记本时,我的浏览器中出现了一个空白屏幕,当我尝试加载旧笔记本。我在命令行中看不到任何错误。之后,我安装了 anaconda (Python3),希望由于它是自包含的,它可以解决问题,但事实并非如此。关于什么可能导致这种行为的任何想法?

编辑:

Web 控制台显示多个错误和警告。在笔记本主页中显示:

Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead main.min.js:1:0
accessing `Notebook` is deprecated. Use `require("notebook/js/notebook").Notebook` main.min.js:28:11
Error: Module name "notebook/js/notebook" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded require.js:165:17
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead. main.min.js:5:12747
Reenabling autorefresh too close to last tree refresh, not refreshing immediately again. main.min.js:15253:13
Reenabling autorefresh too close to last tree refresh, not refreshing immediately again. main.min.js:15253:13

但是,笔记本主页按预期工作。新的 Python 3 笔记本还显示 JS 警告和错误:

Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead main.min.js:86:0
accessing `Notebook` is deprecated. Use `require("notebook/js/notebook").Notebook` main.min.js:21:11
accessing `RawCell` is deprecated. Use `require("notebook/js/textcell").RawCell` main.min.js:21:11
accessing `Cell` is deprecated. Use `require("notebook/js/cell").Cell` main.min.js:21:11
accessing `TextCell` is deprecated. Use `require("notebook/js/textcell").TextCell` main.min.js:21:11
accessing `MarkdownCell` is deprecated. Use `require("notebook/js/textcell").MarkdownCell` main.min.js:21:11
TypeError: IPython.HeadingCell is undefined custom.js:8:5
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead. main.min.js:90:12747
Loaded extension: widgets/notebook/js/extension main.min.js:12030:17
TypeError: IPython.notebook is undefined

暂时

/usr/bin/ipython3 notebook

和开始一样工作,即,我可以正常执行所有操作,但箭头键和 home、end、pgUp、pgDown、插入和删除都不起作用。

提前致谢。

【问题讨论】:

  • 可能是浏览器缓存。多次按 Ctrl-F5 强制清除缓存并刷新。
  • @Thomas K 感谢您的建议,但多次按 Ctrl-F5 并没有解决问题
  • 浏览器的JS控制台有错误吗?
  • @ThomasK JS 控制台有几个错误(见编辑)。他们似乎是我的问题的原因。你能指出如何解决它们吗?
  • 我仍然怀疑浏览器缓存。你能用--port=8889(或任何不是它通常运行的端口的数字)运行笔记本吗?那应该避免它在缓存中的内容。

标签: python ipython anaconda jupyter


【解决方案1】:

我忘记了我已经按照http://undefd.kaihola.fi/2013/10/25/emacs-keybindings-for-ipython-notebook-and-firefox.html 中的说明修改了custom.js 文件,这解释了为什么在升级到jupyter 之前光标键不起作用。显然,此修改与笔记本的 jupyter 版本不兼容。一旦我从 .jupyter 目录中删除了相应的文件,问题就解决了。

【讨论】:

  • 您是否设法以不同的方式使用 emacs 键绑定?
  • 有一个 emacs ipython 项目,但我无法让它工作。这是该项目的链接:tkf.github.io/emacs-ipython-notebook
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-15
  • 2015-05-12
  • 1970-01-01
  • 2017-03-22
  • 2016-04-11
相关资源
最近更新 更多