Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to display Jupyter Widget of typeHBox; widgets JavaScript library missing?

I am trying to use keras-tqdm to get a progress bar in my Jupyter notebook when training models with Keras, but I'm stuck on the following error message:

Failed to display Jupyter Widget of type HBox.

If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.

If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.

I have visited the documentation page that they link to and have executed their commands. Nothing seems to work, and I'm lost as to what the next step is.

Earlier it just said that I had an old version of the JavaScript widgets, and that I needed a newer one. I followed various instructions in order to try to update the JavaScript widgets, and that's how this happened.

To be clear, here is the command from the documentation:

conda install -c conda-forge ipywidgets

when I run it, I get the following:

# All requested packages already installed.
# packages in environment at C:\ProgramData\Anaconda2\envs\py36:
#
ipywidgets                7.1.1                    py36_0    conda-forge

where py36 is the environment that I'm using.

What can I do next?

like image 562
C. E. Avatar asked Jan 31 '18 15:01

C. E.


1 Answers

Do you use new "jupyter lab" by any chance?

Extension system of JupyterLab is quite different. I got it working on CentOS like this:

  1. You must have nodejs installed. Probably the easiest way is to follow official documentation for your OS.
    Example for CentOS (assuming EPEL repo is installed):

    sudo yum install nodejs

  2. npm should be able to install packages, so if you are behind proxy: npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080

  3. Follow ipywidgets install instructions:

    jupyter labextension install @jupyter-widgets/jupyterlab-manager

The last command uses npm to install nodejs package for ipywidgets and its dependencies.

like image 186
Vladimir Yashin Avatar answered Oct 13 '22 16:10

Vladimir Yashin