-
Notifications
You must be signed in to change notification settings - Fork 293
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
DS: Enable Jupyter widgets (aka ipywidgets) #3767
Comments
This would be very helpful for one of my projects. Do we know a rough outline of what needs completed in order to implement this? |
I have a feeling we'll need something along these lines: Beaker (at least plots) is using a custom jupyter widget mime type: |
This is also likely part of the solution: |
Yeah looking at the examples here: We're going to have to refactor our jupyter communication to exist in our react control instead of the main extension. |
Another solution is to try out the transform-widgets react package from nteract @rchiodo /cc |
See this issue for some more hints |
MVP
Long term goals
Challenges/Unknowns
Solution
Estimates (total 14.5)
** Updates to Estimates 7th Jan 2020 **
|
test of today version on winpython:
|
@stonebig not sure what you mean. We haven't submitted any code for ipywidgets support yet. So it's expected that ipywidgets don't work. Can you go into more detail about latex expressions? Perhaps you're hitting this issue: |
Yes probably same latex issue, with a $$ formula |
Hey folks, just wondering if this is still targeted for the February release? |
No, sorry, it didn't make it in. Hopefully March. |
Couldn't fit this in February release due to unexpected complications supporting Custom Editors. For March, it's still iffy. |
Any updates on a planned release for this feature? |
The current plan is our next release, pending some last minute issues we've found (like this one): |
This feature has been released hence closing this issue. |
Thanks, improved my work flow significantly! %matplotlib notebook
import matplotlib.pyplot as plt
plt.plot([1,2,0]) yields:
|
Thanks for the fast reply @rchiodo, appreciate it. I will give |
Got it working. For anyone else struggling, this works in VSCode:
|
For me, import numpy as np
from ipywidgets import interact
@interact(a=(1.0, 4.0, 0.01), b=(0, 10.0, 0.01), color=['red', 'green', 'blue'])
def update(a=3.6, b=4.3, color='blue'):
print(a, b, color) doesn't show any widgets. The Jupyter log in VS code shows: However, running the very same code within the very same |
@rhaschke What's your version of the python extension? That's the part that has the ipywidgets support. |
The python extension states the version: 2020.5.78807 I just tried on another, freshly installed machine. There, VS code asked to install jupyter support, because it wasn't yet installed in the system. On this machine (Ubuntu 20.04), after installing all required packages via VS code in |
Sorry but I haven't the foggiest. If it works in jupyter it should work for us. We're using the same environment. |
On the machine where it doesn't work, can you bring up the webview developer tools? (It's in the command palette). The console there may shed some light on why we don't load the widgets. Did you try other widgets too? Like this?
|
If you have installed Jupyter in different environments try checking |
Same issue with
Edit: The first two warnings (from
|
This makes me feel like it might be jupyter not responding with the correct information:
What is the version of jupyter (and ipython) on both machines? Edit: |
On the (working) Ubuntu 20.04 machine, I have:
|
I would assume that's the problem then. |
It's a bit disappointing that I cannot use the system-installed jupyter version, particularly because this works fine directly in the browser. I will try to install a newer jupyter version system-wide in |
Using vscode-installed jupyter packages it works on the Ubuntu 18.04 machine as well.
Except ipywidgets, all versions are identical up to patch version. So, indeed, looks like vscode is bound to a very recent ipywidgets version and cannot work with the system versions provided by default Ubuntu installs. |
We should probably check that then. Put up a warning. |
ipywidgets 7 came out August 2017, so 2.5 years ago. You'll definitely need ipywidgets at least 7. |
Sorry, I just falsified my assumption: I installed ipywidgets 7.5.1 on top of the system one. This version is correctly reported by jupyter and vscode. Nevertheless, widgets are not working with this installation. webview developer console reports:
|
Ubuntu 20.04 (just released a few weeks ago) still ships ipywidgets 6.0.0. 😢 |
I'm not sure it's ipywidgets that's the culprit. It's more likely the kernel. Or some combination of the two. But we'll have to figure out minimum versions for each. |
Thanks for your help so far. |
Progress bars don't work for me. Result: Expected result: |
@nickcorona can you open a separate issue? This issue is closed and is really about the general support for ipywidgets. If a specific widget doesn't work please open a new issue for that. Thanks. |
Does plot viewer work with it? I have my interactive plots working in my VScode Jupyter notebook but for some reason it won't let me open it into a separate screen (i.e., plot viewer). Thanks! |
Sorry but widget based plots are not connected to our external viewer. |
@JonesKenzie can you enter a new issue? We'll need more logging to determine what the problem is. |
I use BeakerX widget in Jupyter a lot to explore my pandas data frames. It will be great if this feature can be added to vscode (and in general the support for Jupyter Widgets in vscode)
The text was updated successfully, but these errors were encountered: