For a project we try to expand the Google Cloud Datalab with IPyWidgets. When we try out IPyWidgets in jupyter notebook (not in google-cloud-datalab) locally, everything run as expected (i.e. we tried to show a Text field, which worked). When we try to execute the same code in Google Cloud Datalab, it fails. In the web console we see following error:
Error 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"
Error 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"
The strange thing is, is when google-cloud-datalab is running and we go to the jupyter notebook (on port 9000), and we execute the code over there it works.
Do we need to make changes to nb.html, and/or static.ts to make this work?
Question: Is there a way to execute IPyWidgets on Google Cloud Datalab?
Greetings, Brecht
Edit: I can now load the js and the css files from IPyWidgets in google-cloud-datalab (you need to change static.ts, for those who wonder). The only remaining issue (hopefully), is that we get following error:
"Error: Could not determine where the display message was from. Widget will not be displayed".
This is because
var cell = this.get_msg_cell(msg.parent_header.msg_id);
is null (line 556, of ipywidgets/widgets/js/manager.js). I assume that changing static.ts is not enough?