Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"WidgetManager: failed, Loading class" Error in VSCode when calling a toggleButton. No Error. No Output. #11234

Closed
1 of 2 tasks
Jeandewet opened this issue Aug 31, 2022 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ipywidgets Rendering, loading, saving, anything to do with IPyWidgets

Comments

@Jeandewet
Copy link

Jeandewet commented Aug 31, 2022

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

I ran the below snippet of python code in a code cell in a notebook in vscode.

import ipywidgets as widgets

ignition = widgets.ToggleButton(
    value=False,
    description='Start Engine',
    button_style='success',
    tooltip='Engage your Engine',
    icon='rocket'
)

output = widgets.Output()

display(ignition, output)

def on_value_change(change):
    with output:
        if change['new'] == True:
            print("engine started!")
        else:   
            print("engine stopped")

ignition.observe(on_value_change, names='value')

As I am a beginner with this type of coding, I'm not sure if the above snippet has any issues since it seems to complete with no errors.

In saying that, the output is completely blank.

The above code works perfectly in an online instance of a Jupyter Notebook but not in VSCode. I have searched everywhere but I can't seem to find anything that solves my issues.

Versions:

IPython          : 8.4.0
ipykernel        : 6.15.2
ipywidgets       : 8.0.1
jupyter_client   : 7.3.5 
jupyter_core     : 4.11.1
jupyter_server   : 1.18.1
jupyterlab       : 3.4.5
nbclient         : 0.5.13
nbconvert        : 6.5.3
nbformat         : 5.4.0 
notebook         : 6.4.12
qtconsole        : 5.3.2
traitlets        : 5.3.0

VS Code Version

Version: 1.70.2 (system setup) Commit: e4503b30fc78200f846c62cf8091b76ff5547662 Date: 2022-08-16T05:35:13.448Z Electron: 18.3.5 Chromium: 100.0.4896.160 Node.js: 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0.19044

Jupyter Extension Version

v2022.8.1002431052 Pre-Release

Jupyter logs

info 14:7:28.560: Cell 1 executed with state Success
info 14:7:28.580: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 14:7:28.596: Widget Message: WidgetManager: Loading class ToggleButtonStyleModel:@jupyter-widgets/controls:2.0.0
info 14:7:28.596: Widget Message: Waiting for model to be available before rendering it 9c821c3cbe624a408e3cf0828213ec48
info 14:7:28.596: Widget Message: Waiting for model to be available before rendering it 2eb71779b82b465bbcecbacd4af26d18
info 14:7:28.610: Widget Message: WidgetManager: failed, Loading class ToggleButtonStyleModel:@jupyter-widgets/controls:2.0.0
info 14:7:28.610: Widget Message: WidgetManager: failed, Loading class ToggleButtonStyleModel:@jupyter-widgets/controls:2.0.0
error 14:7:28.610: Widget load failure {} {
  className: 'ToggleButtonStyleModel',
  moduleName: '@jupyter-widgets/controls',
  moduleVersion: '2.0.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: '{}'
}
info 14:7:28.613: Widget Message: WidgetManager: Loading class ToggleButtonModel:@jupyter-widgets/controls:2.0.0
info 14:7:28.614: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 14:7:28.618: Widget Message: WidgetManager: Loading class OutputModel:@jupyter-widgets/output:1.0.0
info 14:7:28.619: Widget Message: Received display data message 9c821c3cbe624a408e3cf0828213ec48
info 14:7:28.619: Widget Message: Error: Failed to render widget 9c821c3cbe624a408e3cf0828213ec48, Error: Module @jupyter-widgets/controls, semver range ^2.0.0 is not registered as a widget module
info 14:7:28.619: Widget Message: Received display data message 2eb71779b82b465bbcecbacd4af26d18
info 14:7:28.619: Widget Message: WidgetManager: Loading class OutputView:@jupyter-widgets/output:1.0.0
info 14:7:28.620: Widget Message: WidgetManager: Loading class LayoutView:@jupyter-widgets/base:2.0.0

Coding Language and Runtime Version

Python 3.9.6 64-bit

Language Extension Version (if applicable)

v2022.15.12421005 Pre-Release

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

@Jeandewet Jeandewet added bug Issue identified by VS Code Team member as probable bug triage-needed Issue needs to be triaged labels Aug 31, 2022
@IanMatthewHuff IanMatthewHuff added ipywidgets Rendering, loading, saving, anything to do with IPyWidgets and removed triage-needed Issue needs to be triaged labels Aug 31, 2022
@DonJayamanne
Copy link
Contributor

Duplicate of #8552

@DonJayamanne DonJayamanne marked this as a duplicate of #8552 Aug 31, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug ipywidgets Rendering, loading, saving, anything to do with IPyWidgets
Projects
None yet
Development

No branches or pull requests

3 participants