-
Notifications
You must be signed in to change notification settings - Fork 948
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
ipywidgets do not work properly #2553
Comments
I am also experiencing the same thing in jupyterlab. Not sure it is related, I am running the notebook on a server and uses ssh tunnelling to access it. The classic notebook works fine on the server. I have a similar local installation which is working fine which jupyterlab. |
@alex4200 - please follow the installation instructions for JupyterLab: https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension Basically, you need to do:
and have nodejs installed for jupyterlab to rebuild itself. |
@jasongrout Thanks for your reply, but I am not the admin of the system where the notebooks are set up. I am looking more for a way to debug this issue, as the system/circumstances are way more complicated. First, there is a central instance of there this is set up. I assume it is set up the same for each user. Each user has a container running in a VM, in which the notebook kernel is running. Each user can have a different set of environment (i.e. different pieces of software installed by pip). Now it happens that the Also, as it happens, the above example now works as expected, without any apparent change I made to the system/environment. |
I'm also having the same issue. It happens with the sidecar extension too - I think I've installed and enabled extensions correctly:
I've tried running the install commands again, as suggested by @jasongrout. It all works as expected in a classic notebook (like @diallobakary4). |
I think this the same as #2220 and #2361? @jasongrout's suggestion to run |
@joshwarren As I am not an admin of the jupyter notebook - is there nothing that I can do from inside a running notebook? Just to be clear: I am using a jupyter notebook on some browser. I do not know where the actual notebook runs, how it was started etc., I am just using a running notebook. Is there a way to fix these If it is the latter: What to tell them? Restart jupyter? Restart the container? Restart the kernel? Reinstall the addon? Something else? |
@alex4200 ah I'm afraid my fix was for a similar issue with jupyter lab: it worked fine within a classic notebook for me. Sorry - I'm not much help. |
@alex4200 - just to be clear, you are talking about using a notebook inside JupyterLab, right? As for debugging, probably the most helpful would be the javascript console errors. Also, you can go to the extension manager (enabled from the Setting menu), and see if the |
@jasongrout As far as I know the notebook is running inside JupyterHub (server version 5.0.0). And here I do not see any option 'extension manager'. The UI looks as follows (and now the extension works fine, by chance. Some next time it will not work fine again): I can check the console and will list it here when it stop working again. |
Ah, somehow I missed that this was in the classic Notebook and not in JupyterLab. Still, any javascript errors in the browser js console likely will reveal something about what the problem is. |
Now I have a different output:
For me |
This message is from an old version of ipywidgets. Likely |
Version is 7.0.5 currently. Console gives error |
It seems that there is something wrong in your installation, or perhaps a mismatch between the version in the python kernel and the version in the javascript. I would suggest uninstalling and reinstalling widgets (preferably installing the latest version) as the simplest way to fix whatever is wrong. |
Is there any way to fix that without 'uninstalling and reinstalling widgets', as that would involved other people? I do not have the user rights to 'uninstall and reinstall' widgets, and solving the problem by my own would help much! |
ipywidgets 7.0.5 was released about 2 years ago, it may be good to upgrade anyway. And again, likely this is a configuration or version mismatch issue (or perhaps a bug fixed in the last two years?). It seems that things have evolved since you first posted the issue (where you had ipywidgets 7.5.1), and it's difficult to understand how things are set up right now and thus how to help. If you have to diagnose your current setup, some information would help:
|
The general problem is that there are different notebooks that might install a different version of ipywidgets/widgetsnbextension, along of different version of other countless packages. So I run one notebook which installs some set A, then another notebook installs set B, notebook 3 installs set C, and of course there can be a LOT of version mismatch. But I am interested in the ones for |
So every time you run from ipywidgets import Text
Text("Hello") in a fresh notebook kernel, you get
in the output and
as a corresponding message in the js console? And just to be clear, this notebook has a cell at the top that says |
Yes I guess you are correct.
But how the js was installed - I have no idea. I am not the admin of the jupyter framework, I am just using it. |
Can you refresh your browser after installing the widgetsnbextension package to make sure you are picking up the javascript? If that doesn't work - I'm out of ideas now. It sound like there are a lot of variables and moving pieces, and it would probably be best to talk to your system administrators. |
Yes I can try to reload the pages. And yes there are a lot of moving pieces. I just wanted to find that piece that is moving out, to fix that. But I guess this is too complicated to do? |
I asked the admins to 'reset' the container the jupyter notebook is running in (back to basic configuration). After a reload of the page the |
Good to know it finally worked out for you. It's always a good idea to start again from a clean environment. Closing this now, but feel free to reopen it if needed. |
…o have arbitrary JSON There are a number of people posting issues with nbformat 5 being stricter about validating notebook format 4.1, including: jupyter#160 jupyter#161 jupyter-widgets/ipywidgets#2553 jupyter-widgets/ipywidgets#2788 Essentially, nbformat package version 4.x allowed noncompliant format 4.1 notebooks to be verified as valid, leading to many notebooks in the wild having major/minor format version 4.1, but with widgets and other json outputs that were technically invalid. Upgrading to nbformat package 5.x correctly flagged these notebook as noncompliant. This is correct technically. However, practically it means that all these notebooks files tagged as format 4.1 that were working fine suddenly won't even open after upgrading to nbformat version 5. This is a pain. This retroactively upgrades the format 4.1 schema to allow json in these cases, since in practice there are lots of notebooks labeled as format 4.1, I think by official Jupyter software, that have json in the mimebundle output. Essentially, this acknowledges that in the official implementations from Jupyter, notebook format 4.1 has indeed had arbitrary JSON values in mimebundles, and we cannot in good conscience decree it invalid.
Using
ipywidgets
7.5.1 I have tried to enable this extension:!jupyter nbextension enable --py widgetsnbextension
and then to use the following example, after restarting the kernel and reloading the page:
But the output is always the following:
Text(value='Hello')
How can this be fixed/debugged?
The text was updated successfully, but these errors were encountered: