Error displaying widget model not found catboost

I followed your installation instructions on a fresh python and jupyter setup with pip but end up with “Error displaying widget: model not found” even if I try to run the provided examples under Ju...

I am having the same issue. Also:

root@vagrant:~# jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib
Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details:  /tmp/jupyterlab-debug-57792pd3.log
root@vagrant:~# jupyter labextension list
JupyterLab v1.2.1
Known labextensions:
   app dir: /usr/local/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v1.1.0  enabled  OK
        @jupyterlab/git v0.8.2  enabled  OK
        @jupyterlab/toc v1.0.1  enabled  OK
        @krassowski/jupyterlab_go_to_definition v0.7.1  enabled  OK
        @lckr/jupyterlab_variableinspector v0.3.0  enabled  OK
        @ryantam626/jupyterlab_sublime v0.2.0  enabled  OK
        jupyter-matplotlib v0.4.2  enabled  OK
        jupyterlab-drawio v0.6.0  enabled  OK
        nbdime-jupyterlab v1.0.0  enabled  OK
root@vagrant:~# pip show ipywidgets
Name: ipywidgets
Version: 7.5.1
Summary: IPython HTML widgets for Jupyter
Home-page: http://ipython.org
Author: IPython Development Team
Author-email: ipython-dev@scipy.org
License: BSD
Location: /usr/local/lib/python3.7/dist-packages
Requires: ipykernel, traitlets, ipython, widgetsnbextension, nbformat
Required-by: ipympl

Funny thing was, I had this working… until I added a different extension (which triggered a rebuild). After which, it broke. This is running in a VM with 1GB ram. I will try upping the memory and see if that fixes the problem. (might be the minimize part of the build running out of ram — I do see swapfile use).
That logfile ended in:

> node /usr/local/lib/python3.7/dist-packages/jupyterlab/staging/yarn.js run build:prod:minimize
yarn run v1.15.2
$ ensure-max-old-space webpack --config webpack.prod.minimize.config.js
child_process.js:642
    throw err;
    ^

Error: Command failed: webpack --config webpack.prod.minimize.config.js
    at checkExecSyncError (child_process.js:621:11)
    at Object.execFileSync (child_process.js:639:15)
    at Object.<anonymous> (/usr/local/share/jupyter/lab/staging/node_modules/@jupyterlab/buildutils/lib/ensure-max-old-space.js:30:17)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11 {
  status: null,
  signal: 'SIGKILL',
  output: [ null, null, null ],
  pid: 1320,
  stdout: null,
  stderr: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

JupyterLab failed to build
Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/labextensions.py", line 105, in start
    command=command, app_options=app_options)

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/commands.py", line 459, in build
    command=command, clean_staging=clean_staging)

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/commands.py", line 669, in build
    raise RuntimeError(msg)

RuntimeError: JupyterLab failed to build

Exiting application: jupyter

It seems like the gui-managed rebuild process sometimes silently fails this way during the rebuild of jupyter-matplotlib, leaving the widget javascript missing.

I’ll see if throwing more memory at it helps (was using the default vagrant config which was only 1GB). BTW I am bulding within a singularity image, on a vagrant managed virtualbox VM on windows.
The exact fork is at https://github.com/RGD2/jupyter/tree/pipjupyterlab which works, (with working matplot lib) but with wierd steps which involve repeated builds and refreshs (see the commit message for those steps).

Python is one of the easiest languages to start programming if you’re a beginner. Not only is it extremely easy, but there are also hundreds if not thousands of external libraries that programmers can download and use to further integrate added functionality. 

In this article, we’re talking about the “Error displaying widget: model not found” problem when using Jupyter Labs in Python. 


ipywidgets version 7.5 has a bug that’s known to break Jupyter Labs’ functionality and sometimes affects other libarires as well. If you’re using version 7.5 or above and are facing this problem, try downgrading to version 7 to see if that solves your problem. 

Also read: Python vs R: Which one is better?


If downgrading the version didn’t help you, delete ipywidgets and install it again along with ipympl to see if that fixes the problem. Run the following commands one after another in a terminal window.

pip install ipywidgets
conda install -c conda-forge ipympl

Once the installation is complete, check if the lab extensions list is okay by using the following command.

!jupyter labextension list

If the output shows all OK, restart Jupyter Notebook and you’re good to go. 


jupyterlab_widgets is a library that helps Jupyter show widgets as program outputs. If for some reason the library ins’t working as expected, you can run into problems. Reinstall the library by entering the following commands one at a time. 

pip uninstall jupyterlab_widgets
pip install jupyterlab_widgets

Also read: How to fix ‘error: metadata-generation-failed’?


Install jupyter-matplotlib

The regular version of matplotlib sometimes causes problems when used with Jupyter. To resolve this, use jupyter-matplotlib instead. You can install the extension straight from the jupyter-matplotlib directory using the command below.

jupyter labextension install js

Reinstall the Jupyter library

Reinstalling Jupyter and all the dependencies can resolve seemingly random issues that may be happening because of missing references or files. To make it easier, we’ve combined the entire process into one command. 

jupyter labextension uninstall jupyter-matplotlib && jupyter labextension uninstall @jupyter-widgets/jupyterlab-manager && conda update -y widgetsnbextension && conda update -y nodejs && pip uninstall -y ipympl && pip install git+https://github.com/matplotlib/jupyter-matplotlib.git#egg=ipympl && conda update jupyterlab -y && jupyter labextension install @jupyter-widgets/jupyterlab-manager && jupyter labextension install jupyter-matplotlib && jupyter labextension update --all && jupyter lab build && jupyter nbextension list && jupyter labextension list

Also read: Lost Ark error code 30005: 7 Fixes

Yadullah Abidi

Someone who writes/edits/shoots/hosts all things tech and when he’s not, streams himself racing virtual cars.

You can contact him here: [email protected]


8

ответов

а если plot=False обучение идет? отрисовка графиков например в коллабе у меня не пошла

07:00 25.06.2022


Dmitry Boldyrev

а если plot=False обучение идет? отрисовка графико…

идет, вот и у меня

07:01 25.06.2022

Ну хорошо, а по логам что тогда? как было установлено, что произошло переобучение, и ничего не учится?

07:29 25.06.2022

Помогает перезагрузка блокнота. Катбуст здесь ни при чем.

08:56 25.06.2022


Сергей

Помогает перезагрузка блокнота. Катбуст здесь ни п…

Я вроде уже перезагружал. Но попробую ещё

10:06 25.06.2022


Сергей

Помогает перезагрузка блокнота. Катбуст здесь ни п…

как-то каждый раз с ошибкой

11:08 25.06.2022


Алексей

как-то каждый раз с ошибкой

Попробуй поискать на Kaggle, там с этим уже сталкивались, мне помог вариант с перезагрузкой

11:10 25.06.2022

What ipywidgets and catboost version do you have?
Could you open a browser console and check for errors please? Cmd+shift+i (or ctrl+shift+i)

This is the error from Jupyter Lab
«
Failed to display Jupyter Widget of type CatboostIpythonWidget.

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.
«

versions:
catboost 0.6.1
ipywidgets 7.1.1 py36_0

error on console:
«Error: Object ‘jupyter.widget’ not found in registry»

I need to check jupyter lab compatibility

I had the same error:
My jupyterlab and catboost are all freshly installed.
«`Failed to display Jupyter Widget of type MetricVisualizer.

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.«`

Same issue for me: I get a ‘Error displaying widget’
Config:
jupyterlab 0.31.12
catboost 0.7.2.3
ipywidgets 7.0.5

Things I’ve already tried:

  1. from console before launching Jupyter lab:

jupyter nbextension enable —py widgetsnbextension

  1. Added various imports:
    from __future__ import print_function
    from ipywidgets import interact, interactive, fixed, interact_manual
    import ipywidgets as widgets
    from IPython.display import display

Neither of these display the widget. I always get the same error: ‘Error displaying widget’

BTW, I installed catboost into my python 3.6 conda install, using pip. However, the notebook I’m using, from here:
https://github.com/catboost/catboost/blob/master/catboost/tutorials/catboost_python_tutorial.ipynb

was using a Python2 kernel. I’m trying to adapt it to Python3, which may be at the root of the issue.

Thanks for any insight!

I think the jupyterlab is probably the issue here, as it is still fairly new thing. My experience with plotly was the same that Jupyterlab won’t work with it. However, there is a renderer you can install to display the image. https://github.com/jupyterlab/jupyter-renderers

I have installed the plotly one, which I believe is what behind catboost’s visualisation, so far no luck in displaying the figure

@herbzhao — Thank you so much for your response. I tried out the renderer you suggested, but plotly still failed in lab. It works in classic notebook, though, so I’ll go with that for now. Thanks again for your help!

We cannot do anything here unfortunatelly, so I’m closing the issue.

Was this closed because you decided not to create the Jupyter Lab extension or for some other reason. Was fairly confusing trying to diagnose this error.

Looks like Anna closed the issue to me, not a huge deal. Gotcha I guess I’m misunderstanding something. To me it sounded like Lab can run doesn’t directly support in-line JS, but if you wanted to create a custom JS widget that works in lab you would create a jupyter lab extension for it. Not sure what the scope of porting it to an extension is.

Thanks again for the follow up, Peter. I don’t intend to write a custom JS
widget for this; my need for the functionality expired a few months ago. I
hope someone does, though, in the future, as it’s a pretty cool widget, and
I think the Jupyter community is moving toward Lab as the de facto standard.

Cheers,
Gary

On Thu, Sep 27, 2018 at 09:28 Peter C Campbell notifications@github.com
wrote:

Looks like Anna closed the issue to me, not a huge deal. Gotcha I guess
I’m misunderstanding something. To me it sounded like Lab can run doesn’t
directly support in-line JS, but if you wanted to create a custom JS widget
that works in lab you would create a jupyter lab extension for it. Not sure
what the scope of porting it to an extension is.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/catboost/catboost/issues/262#issuecomment-425136537,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AhHQ47ER259RPublzBElyRIGo-zqLAwkks5ufO6TgaJpZM4SWNga
.

It looks like JupyterLab just made a 1.0 release, and it might be possible to create third-party widges there.
We’ll look into this.

@annaveronika any updates on this? Would be really great to get plotting works in jlab.

We are not working on that, we would very much appreciate any help!

ipywidgets have JupyterLab extension now — https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension. Maybe it will help to start working on it?)

Any progress on this, I’m using the python extension for vscode and it would be nice to get catboost plotting to work with it?

ipywidgets have JupyterLab extension now — https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension. Maybe it will help to start working on it?)

It does not appear to work for me

I get the following JS error;

Uncaught TypeError: define is not a function
    at <anonymous>:1572:1
    at t.attachWidget (vendors~main.8bb1d351222f6eb40331.js:2)
    at t.insertWidget (vendors~main.8bb1d351222f6eb40331.js:2)
    at y._insertOutput (vendors~main.8bb1d351222f6eb40331.js:2)
    at y.onModelChanged (vendors~main.8bb1d351222f6eb40331.js:2)
    at m (vendors~main.8bb1d351222f6eb40331.js:2)
    at Object.c [as emit] (vendors~main.8bb1d351222f6eb40331.js:2)
    at e.emit (vendors~main.8bb1d351222f6eb40331.js:2)
    at c._onListChanged (vendors~main.8bb1d351222f6eb40331.js:2)
    at m (vendors~main.8bb1d351222f6eb40331.js:2)
vendors~main.8bb1d351222f6eb40331.js:2 

Error: Could not create a view for model id c9bccf7808cc4f0cb313cd8f7bc72ec8
    at n (vendors~main.8bb1d351222f6eb40331.js:2)
n @ vendors~main.8bb1d351222f6eb40331.js:2
vendors~main.8bb1d351222f6eb40331.js:2 

Error: Could not create view
    at n (vendors~main.8bb1d351222f6eb40331.js:2)
    at async h.renderModel (vendors~main.8bb1d351222f6eb40331.js:2)
n @ vendors~main.8bb1d351222f6eb40331.js:2
vendors~main.8bb1d351222f6eb40331.js:2 

Error: Module catboost_module, semver range  is not registered as a widget module
    at C.loadClass (vendors~main.8bb1d351222f6eb40331.js:2)
    at vendors~main.8bb1d351222f6eb40331.js:2
renderModel @ vendors~main.8bb1d351222f6eb40331.js:2
vendors~main.8bb1d351222f6eb40331.js:2 

Error: Could not process update msg for model id: c9bccf7808cc4f0cb313cd8f7bc72ec8
    at n (vendors~main.8bb1d351222f6eb40331.js:2)
    at async b._handleCommMsg (vendors~main.8bb1d351222f6eb40331.js:2)
    at async b._handleMessage (vendors~main.8bb1d351222f6eb40331.js:2)
n @ vendors~main.8bb1d351222f6eb40331.js:2
vendors~main.8bb1d351222f6eb40331.js:2 Uncaught (in promise) Error: Module catboost_module, semver range  is not registered as a widget module
    at C.loadClass (vendors~main.8bb1d351222f6eb40331.js:2)
    at vendors~main.8bb1d351222f6eb40331.js:2
15vendors~main.8bb1d351222f6eb40331.js:2 

Error: Could not process update msg for model id: c9bccf7808cc4f0cb313cd8f7bc72ec8
    at n (vendors~main.8bb1d351222f6eb40331.js:2)
    at async b._handleCommMsg (vendors~main.8bb1d351222f6eb40331.js:2)
    at async b._handleMessage (vendors~main.8bb1d351222f6eb40331.js:2)
n @ vendors~main.8bb1d351222f6eb40331.js:2

To whom it may concern,

Today, I just open Mandelbrot Demo ( /mandelbrot/mandelbrot.ipynb ) at Intel DevCloud for oneAPI, then run first cell «Device Selector».  The result is «Error displaying widget: model not found» instead displaying Radio Buttons.  Could you confirm it?

screenshot_2022-10-07_180341.png

For now, it looks like issue of «jupyterlab-widgets» and/or «ipywidget» package installation. This issue is not critical/blocker, but it’s NOT good.

Best regards,

Hiroshi

1 Solution

I would like to propose a workaround while the notebook gets fixed.

At this time the ipywidgets module is not loading for some reason.

Dan_P_Intel_0-1667257391888.png

In the «Build and Run» section, you need to replace:

  1. «{device.value}» to «GPU Gen9»
  2. code based on ipywidgets with the following:
    from IPython.display import Image
    Image('build/mandelbrot.png')

  • All forum topics


  • Previous topic

  • Next topic

4 Replies

Hi,

Good day to you.

Thanks for posting in Intel Communities.

Thanks for reporting this issue. 

We were able to reproduce it and we have informed the development team about it.

Thank You.

I would like to propose a workaround while the notebook gets fixed.

At this time the ipywidgets module is not loading for some reason.

Dan_P_Intel_0-1667257391888.png

In the «Build and Run» section, you need to replace:

  1. «{device.value}» to «GPU Gen9»
  2. code based on ipywidgets with the following:
    from IPython.display import Image
    Image('build/mandelbrot.png')

Hi,

Could you please give us an update?

Is the workaround provided by @Dan_P_Intel helpful to you?

If it resolves your issue, please make sure to accept it as a solution. This would help others with similar issues.

Thank you! 

Hi,

Thanks for accepting our solution. 

If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.

Thank You.


  • All forum topics


  • Previous topic

  • Next topic

Понравилась статья? Поделить с друзьями:
  • Error displaying the error page application instantiation error failed to start the session
  • Error displaying the error page application instantiation error could not connect to mysql перевод
  • Error displaying captcha
  • Error dispatching request to reading input brigade
  • Error dism dismhostlib failed to create dismhost exe servicing process