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.

JS not detected, widget not found error

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
jasongroutcommented, Sep 4, 2017

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__ and import widgetsnbextension; widgetsnbextension.__version__

it is my understanding that conda should run that for me anyway.

Only for the conda-forge package. Anaconda has a policy against running code, so the Anaconda package does not do it.

2reactions
kebwicommented, Sep 5, 2017

Hmmm, well apparently I’m running ipywidgets 7, from conda-forge no less:

$ conda list
# packages in environment at /Users/kwiley/anaconda/envs/python_3_5:
[...]
ipywidgets                7.0.0                    py35_1    conda-forge
[...]
widgetsnbextension        3.0.2                    py35_0
[...]

I see this confirmed in python as well:

$ python
Python 3.5.4 |Continuum Analytics, Inc.| (default, Aug 14 2017, 12:43:10) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipywidgets; ipywidgets.__version__
'7.0.0'
>>> import widgetsnbextension; widgetsnbextension.__version__
'3.0.2'
>>> 

However, it admittedly gets a little weird when I run from either ipython (the nonnotebook version in the terminal) or from ipython/jupyter notebook:

$ ipython
Python 2.7.12 (default, Oct 11 2016, 14:42:23) 
Type "copyright", "credits" or "license" for more information.

IPython 5.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import ipywidgets; ipywidgets.__version__
Out[1]: '5.2.2'

In [2]: import widgetsnbextension; widgetsnbextension.__version__
Out[2]: '1.2.6'

And from the notebook:

In [1]: import ipywidgets; ipywidgets.__version__
Out[1]: '6.0.0'
In [2]: import widgetsnbextension; widgetsnbextension.__version__
Out[2]: '3.0.2'

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter notebook: Widget Javascript not detected
When I try to run the widget it gives error that there is no javascript widget. I have python3 and R kernels installed...
Read more >
JS error with ipywidgets [RESOLVED] - Kaggle
On trying to write some code, I'm getting a strange error with ipywidgets: Widget Javascript not detected. It may not be installed or...
Read more >
"Widget Javascript not detected" error - Python Forum
Error: net. widget() Widget Javascript not detected. It may not be installed or enabled properly.
Read more >
Again: Widget Javascript not detected
I have a nice little Jupyter notebook to present something to students but it's useless as long as the screen keeps getting flooded...
Read more >
SIGNATURE WIDGET NOT WORKING - Mendix Forum
The error is coming from the frontend javascript trying to load the widget and failing. This could be because it's using a more...
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