Couldn't add children widget to box when rendering widgets
See original GitHub issueHi,
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:
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:
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:
- Created 8 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
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!
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:
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!