0

I’ve discovered JupyterLab may not work well with the ipywidgets package.

After inputting the pip install ipywidgets in the terminal, I ran the following code and unfortunately did not get a widget:

import ipywidgets as widgets
widgets.IntSlider()
from IPython.display import display
w= widgets.IntSlider()
uploader = widgets.FileUpload(accept="*.xlsx",multiple = False
display(uploader)

Instead, I just get a a string output of FileUpload (value=({}, accept='*.xlsx', description='Upload')

Why is this the case, and how can I get widgets to work in JupyterLab?

enter image description here

HelpMeCode
  • 299
  • 2
  • 13
  • 1
    Does this answer your question? [How to get ipywidgets working in Jupyter Lab?](https://stackoverflow.com/questions/49542417/how-to-get-ipywidgets-working-in-jupyter-lab) – piplup Aug 10 '22 at 13:04
  • I concur with @piplup. Your statement, "I’ve discovered JupyterLab may not work well with the ipywidgets package" is not correct. It works well if installed correctly in a way so that it integrates properly with JupyterLab. Cells numbered 2 and 3 in your image each have errors. I don't now what you are trying to do in cell numbered 2. In cell numbered 3, you are trying to run a shell command from inside a Jupyter notebook cell. You'd need to send that to a shell by adding an exclamation point in front of it. Although I don't know if that command is actually the way to fix things. ... – Wayne Aug 10 '22 at 14:54
  • ... Have you followed [here](https://ipywidgets.readthedocs.io/en/7.x/user_install.html#installing-in-jupyterlab-3-0) closely? The proper environments are critical here. Are you using the Anaconda distribution or conda anywhere? If not ... If you run `%pip list` inside your notebook does it show `ipywidgets`. I think when you installed it via `pip` in the terminal it didn't integrate correctly due to environments. From inside the notebook, have you tried `%pip install ipywidgets` and then restarted the kernel? – Wayne Aug 10 '22 at 14:55
  • [This exchange](https://discourse.jupyter.org/t/extension-issues-shemadir-is-empty-schema/15286?u=fomightez) may help you with some suggestions. In that case it was a matter of updating Anaconda, JupyterLab, and the system. – Wayne Aug 10 '22 at 19:15

0 Answers0