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.

Interactive Widgets fail on Apple Silicon, Remote Jupyter & when using non-Raw kernels

See original GitHub issue

Environment data

  • VS Code version: 1.62.3
  • Jupyter Extension version: v2021.10.1101450599
  • Python Extension version: v2021.11.1422169775
  • OS and version: macOS Monterey 12.0.1 running on AppleSilicon Mac
  • Python version: 3.9.5
  • Type of virtual environment used: venv
  • Jupyter server running: Local

Expected behaviour

As you move a slider the function is called multiple times.

Actual behaviour

The function is called once.

Steps to reproduce:

  • Create a Jupiter notebook with this code, which contains a slider.
from ipywidgets import interact

def f(x):
  print(x)
    
interact(f, x=10);
  • Open it in VSCode, move the slider.

Expected behaviour

The widget calls the function f multiple times as you move the slider.

Actual behaviour

The function f is only called once at the beginning:

demo_m1

Notes

  • I could only see the bug on Apple Silicon Mac and not on my Intel Mac.

  • The widget works as expected on Apple Silicon Mac if opened in jupuyter-lab instead of VSCode.

Repository that reproduces the bug

https://github.com/evgenyneu/ipywidgets_vscode_bug

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
DonJayamannecommented, Jan 24, 2022

Testing steps

  • Connect to a remote Jupyter server
  • Create a cell with teh code:
from ipywidgets import interact

def f(x):
  print(x)
    
interact(f, x=10);
  • Run the cell & move the slider
  • Confirm the outputs are updated (both counters)
  • Restart the kernel and re-run the cell and confirm its rendered
1reaction
DonJayamannecommented, Jan 24, 2022

@antonindurieux I’ve managed to identify the fix and got a PR open for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interactive Widgets fail on Apple Silicon, Remote Jupyter ...
Create a Jupiter notebook with this code, which contains a slider. from ipywidgets import interact def f(x): print(x) interact(f, x=10);. Open ...
Read more >
Problem Running Jupyter Notebook on Remot…
Since upgrading to Catalina from El Capitan, I have been experiencing an issue where I am unable to run Jupyter Notebooks on a...
Read more >
Low Level Widget Tutorial - ipywidgets - Read the Docs
Jupyter interactive widgets are interactive elements, think sliders, textboxes, buttons, that have representations both in the kernel (place where code is ...
Read more >
Bring your Jupyter Notebook to life with interactive widgets
This is a complete tutorial of how you can take full control of the widgets to create powerful dashboards. We will start with...
Read more >
Use interactive widgets | IntelliJ IDEA Documentation - JetBrains
IntelliJ IDEA supports interactive widgets that provide integration between Python code running in the notebook kernel and JavaScript ...
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