Jupyter notebook: Widget Javascript not found

Question: I installed python3 and jupyter notebook using pip3 on Mac OS 10.9.
When I try to run the widget, it gives an error that there is no javascript widget. I have python3 and R kernels installed in a Jupyter laptop.

The code:

from ipywidgets import widgets
from IPython.display import display
text = widgets.Text()
display(text)
text.on_submit('hello')

Error:

Widget Javascript not detected.  It may not be installed or enabled properly.  

Attempts:

sudo -H pip3 install ipywidgets  
sudo -H pip3 install -upgrade ipywidgets  
jupyter nbextension enable --py widgetsnbextension
# restarted the computer. 

The last command gives an error.

[EnableNBExtensionApp] CRITICAL | Bad config encountered during initialization:
[EnableNBExtensionApp] CRITICAL | Unrecognized flag: '--py'

Note that on mac I have a jupyter-nbextension command, but the command:

jupyter-nbextension enable --py widgetsnbextension 

doesn't work either.

But it jupyter nbextension enable widgetsnbextensiondoes not make mistakes and does nothing. The same error appears if I run the code.

Besides,

import ipywidgets
ipywidgets.__version__

gives "6.0.0".

Some notes:

which jupyter  
jupyter is /Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
which jupyter-notebook
jupyter-notebook is /Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter-notebook

Related links:

https://github.com/jupyter-widgets/ipywidgets/issues/541    
https://github.com/jupyter/help/issues/32    
https://github.com/jupyter/help/issues/131    
https://github.com/binder-project/binder/issues/83   

How to install widgets? Do I need to install Java separately?

+4
source share
5 answers

: jupyter nbextension enable --py --sys-prefix widgetsnbextension, ​​ Jupyter, .

+2

Jupyter, Mac OS, Python 3.6 Anaconda. ipywidgets ( 7.0).

conda install -c conda-forge ipywidgets

jupyter nbextension enable --py widgetsnbextension
+2

: jupyter nbextension enable --py --sys-prefix widgetsnbextension :

>Enabling notebook extension jupyter-js-widgets/extension...

- Validating: ok. jupyter .

0

:

jupyter labextension install @jupyter-widgets/jupyterlab-manager
0

, , , : ipywidgets widgetsextension, .

pip uninstall ipywidgets widgetsnbextension

pip install ipywidgets

jupyter nbextension enable --py --sys-prefix widgetsnbextension
-2

Source: https://habr.com/ru/post/1676300/


All Articles