question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Couldn't add children widget to box when rendering widgets

See original GitHub issue

Hi,

I don’t know if there is a bug in ipywidgets or if there’s an opportunity to refactor IPythonKernel. I’d appreciate your comments.

I recently created a kernel that inherits directly from IPythonKernel: class MyKernel(IPythonKernel) This MyKernel class is a very thin layer over the IPythonKernel.

On this kernel, if the user tries to display a Widget in MyKernel, they’ll get a Javascript error that I am having a very hard time debugging. Message from browser console below. Notice that the widget tabs omit the content of the widget children: screen shot 2015-11-03 at 6 43 00 pm

When i run the same piece of code that renders the same widget on the real IPythonKernel, it looks like this, with children displaying correctly: screen shot 2015-11-03 at 6 45 17 pm

Any help would be appreciated!

Thanks!

Javascript error message:

Uncaught (in promise) WrappedError {stack: "Error: Couldn't add child view to box↵    at new E…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't add child view to box", error_stack: Array[4]}error_stack: Array[4]0: TypeError: require is not a function
    at http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12740:17
    at Object.load_class (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12736:16)
    at http://localhost:8888/nbextensions/widgets/widgets/js/manager.js?v=20151103005149:74:261: Error: Couldn't create a view for model id '5ce5e524d89f44fd84f229604853b122'
    at new Error (native)
    at Error.WrappedError (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12706:25)
    at http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33message: "Couldn't create a view for model id '5ce5e524d89f44fd84f229604853b122'"stack: (...)get stack: ()set stack: ()__proto__: DefineError.bh2: Error: Couldn't create child view
    at new Error (native)
    at Error.WrappedError (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12706:25)
    at http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33message: "Couldn't create child view"stack: (...)get stack: ()set stack: ()__proto__: DefineError.bh3: Error: Couldn't add child view to box
    at new Error (native)
    at Error.WrappedError (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12706:25)
    at http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33length: 4__proto__: Array[0]message: "Couldn't add child view to box"stack: "Error: Couldn't add child view to box↵    at new Error (native)↵    at Error.WrappedError (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12706:25)↵    at http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33"__proto__: Object

ping @ellisonbg

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aggFTWcommented, Mar 8, 2016

Visitors from the future:

My issue was I had installed ipywidgets via pip with a conda installation and there was indeed a version mismatch between the conda and pip ipywidget installation.

When I resolved the inconsistency, issue went away.

Thanks for the help everyone!

1reaction
aggFTWcommented, Nov 19, 2015

So I’ve been looking at this all night and cannot figure out what’s going on…

Both kernels are using the same Python version, running on the same kernel. Furthermore, I also just experienced this in the ipython kernel itself. It’s weird because I have another notebook where it works.

I installed ipywidgets from master and cleared the browser. Now, I get this error message on first execution:

0: Error: Class ipython.widget not found in registry at http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12751:28 at O (eval at <anonymous> (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), <anonymous>:8:15049) at new V (eval at <anonymous> (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), <anonymous>:8:16254) at Object.load_class (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12736:16) at CommManager.comm_open (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:21802:37) at x.isFunction.i (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:5488) at Kernel._handle_iopub_message (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:23101:20) at Kernel._finish_ws_message (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:22936:29) at http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:22926:44 at P (eval at <anonymous> (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), <anonymous>:8:14792)
1: Error: Could not open comm at new Error (native) at Error.WrappedError (http://localhost:8888/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:12706:25) at...

As far as I know I only have Anaconda’s Python 2.7 (Python 2.7.10 |Anaconda 2.3.0 (x86_64)) and one version of ipywidgets installed (‘4.2.0.dev’).

I did some searches and found this: https://github.com/ipython/ipython/pull/6493 Maybe @SylvainCorlay would know? 😃

@ellisonbg How can I verify if ipywidgets is installed propertly (with the JS) in both? I didn’t quite get that question.

Thanks in advance!

Read more comments on GitHub >

github_iconTop Results From Across the Web

dart - Flutter - Wrap Row of Expanded Widgets - Stack Overflow
I already tried to replace Row by Wrap : return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: Center( child: Wrap( ...
Read more >
How Flutter renders Widgets - YouTube
At Google Developer Days China 2019, Andrew Fitz Gibbon and Matt Sullivan discuss how Flutter works under the hood, and dig deep into ......
Read more >
assorted_layout_widgets | Flutter Package - Pub.dev
Given a list of children widgets, this will arrange them in a column. It can overlap cells, add separators and more. ColumnSuper({ List<Widget>...
Read more >
Expanded class - widgets library - Flutter - Dart API docs
A widget that expands a child of a Row, Column, or Flex so that the child fills the available space. Using an Expanded...
Read more >
Flutter - Mark Volkmann
Everything rendered by a Flutter app is rendered by a "widget". ... Replace the widgets in the children List passed to the Column...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found