JS not detected, widget not found error
See original GitHub issueI’ve seen this symptom reported in other issues, but so far have found no resolution. As a minimal test, I am attempting the following notebook commands:
from ipywidgets import IntSlider
IntSlider()
The result is:
Widget Javascript not detected. It may not be installed or enabled properly.
Error rendering Jupyter widget. Widget not found: {"model_id":"c666e150707e45d994d5c53aff96a6d5"}
If I open the Chrome inspector I see that the jupyter-js-widgets/extension was loaded, but also see the following error:
Wrong widget protocol version: received protocol version '', but was expecting major version '2'
ManagerBase.handle_comm_open @ manager-base.js:134
(anonymous) @ comm.js:89
Promise resolved (async)
CommManager.comm_open @ comm.js:85
i @ jquery.min.js:4
Kernel._handle_iopub_message @ kernel.js:1223
Kernel._finish_ws_message @ kernel.js:1015
(anonymous) @ kernel.js:1006
Promise resolved (async)
Kernel._handle_ws_message @ kernel.js:1006
i @ jquery.min.js:4
I’m working in Anaconda and I’m getting this error with both Python 3.5 and 3.6 environments. I got it with both ipywidgets 6 and 7. Obviously I have tried running ‘jupyter nbextension enable --py widgetsnbextension --sys-prefix’, although to be clear, it is my understanding that conda should run that for me anyway. At any rate, running that command reports that the extension is enabled and validated. At this point, I’ve tried every combination I can think of. I’m totally dead in the water. What do I do now?
Desperate. Help! Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
That combination of messages comes from having widgetsnbextension 3.0 installed with ipywidgets 6.0. I think upgrading to ipywidgets 7 will solve the issue. If not, can you post
conda list
(relevant parts being ipywidgets and widgetsnbextension), and (in python)import ipywidgets; ipywidgets.__version__
andimport widgetsnbextension; widgetsnbextension.__version__
Only for the conda-forge package. Anaconda has a policy against running code, so the Anaconda package does not do it.
Hmmm, well apparently I’m running ipywidgets 7, from conda-forge no less:
I see this confirmed in python as well:
However, it admittedly gets a little weird when I run from either ipython (the nonnotebook version in the terminal) or from ipython/jupyter notebook:
And from the notebook:
Soooo, my ipython and/or jupyter system is not operating correctly. I guess I need to figure out why/how ipython and jupyter are configured relative to python itself, all wrapped up through Anaconda’s intended resource/dependency management system. I realize this is now somewhat off topic of ipywidgets, but if you have any pointers, I would appreciate it. Otherwise, I’ll look into this on my own of course.
Thanks.