对于一个项目,我们尝试用IPyWidgets扩展。当我们在jupyter笔记本(而不是在google datalab中)在本地试用IPyWidgets时,一切都按预期运行(也就是说,我们试图显示一个文本字段,它起作用了)。当我们试图在中执行相同的代码时,它会失败。在web控制台中,我们看到以下错误:
错误1:
Error message: "Class ipython.widget not found in registry "
Error stack: "load_class/<@http://localhost:8081/static/notebook/js/main.min.js:12751:28load_class@http://localhost:8081/static/notebook/js/main.min.js:12736:1CommManager.prototype.comm_open@http://localhost:8081/static/notebook/js/main.min.js:21802:31.proxy/i@http://localhost:8081/static/notebook/js/main.min.js:89:5486Kernel.prototype._handle_iopub_message@http://localhost:8081/static/notebook/js/main.min.js:23101:20Kernel.prototype._finish_ws_message@http://localhost:8081/static/notebook/js/main.min.js:22936:1Kernel.prototype._handle_ws_message/this._msg_queue<@http://localhost:8081/static/notebook/js/main.min.js:22926:39"
错误2:
Message: Could not open comm
Error message: "Couldn't process kernel message"
Error stack: "WrappedError@http://localhost:8081/static/notebook/js/main.min.js:12706:19reject/<@http://localhost:8081/static/notebook/js/main.min.js:12785:33"
奇怪的是,当运行时,我们会访问jupyter笔记本(端口9000),然后在那里执行代码,它可以工作。
我们是否需要对nb.html和/或static.ts进行更改才能完成这项工作?
问题:有办法在Google上执行IPyWidgets吗?
你好,布莱希特
编辑:,我现在可以在google中从IPyWidgets加载js和css文件(对于那些好奇的人,您需要更改static.ts )。剩下的唯一问题(希望如此)是,我们得到了以下错误:
"Error: Could not determine where the display message was from. Widget will not be displayed".
这是因为
var cell = this.get_msg_cell(msg.parent_header.msg_id);
为null (第556行,ipywidget/widget/js/manager.js er.js)。我想仅仅改变static.ts是不够的?
发布于 2016-04-23 04:35:31
以下方面:
"Error: Could not determine where the display message was from. Widget will not be displayed".
可以通过在datalab.js中更改该行来解决问题:
originalExecute.apply(this, [ code, callbacks, options ]);
至:
return originalExecute.apply(this, [ code, callbacks, options ]);
https://stackoverflow.com/questions/36404809
复制相似问题