cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using ipywidgets latest versions

tessaickx
New Contributor III

Hello everyone,

I upgraded my cluster to DBR 13.0, which comes with ipywidgets version 7.7.2 installed.

However, I want to use the TagsInput widget, which is new since version 8.0.4.

If i upgrade the ipywidgets package to version 8.0.4, none of the widgets (like the basic IntSlider) run anymore. I get this error:

"Stale widget: cannot display widget because the python repl changed. Please rerun the notebook"

If I downgrade the version again to 7.7.2, the other widgets work again.

Is there any way i can use the TagsInput widget in my databricks notebook?

Or does anyone know alternatives for that widget? The dbutils widgets doesn't provide enough functionality, I need to select multiple from a list of +- 10k items, with a kind of search function.

Thanks in advance

3 REPLIES 3

Anonymous
Not applicable

@Tessa Ickx​ :

It seems that the issue you are experiencing is related to compatibility between different versions of ipywidgets. The TagsInput widget was introduced in version 8.0.4, so you would need at least that version to use it. However, upgrading to a newer version of ipywidgets might cause issues with the widgets that are already in use in your notebook.

One possible solution would be to use a virtual environment to install a newer version of ipywidgets just for the TagsInput widget. You could create a new environment with a specific version of ipywidgets and install the TagsInput widget in that environment. Then, you could use that environment for the specific notebook where you need to use the TagsInput widget.

Another option would be to use a different library for the functionality you need. One possibility is to use the SelectMultiple widget from ipywidgets, which allows selecting multiple options from a list. You could use a dropdown widget to display the list of available options, and use a text input widget to filter the options based on the user's input.

Alternatively, you could also consider using a different library, such as react-select or react-virtualized-select, which provide more advanced features for selecting multiple options from a large list. These libraries are based on React and can be used in a notebook by embedding them in an iframe using the

displayHTML function from IPython.core.display.

I hope this helps!

tessaickx
New Contributor III

Hello Suteja,

Thank you for the reply. However, I think you didn't understand me correctly.

If I use a version older than version 8.x.x., everything works fine, except the TagsInput of course because it wasn't introduced yet. If I use version 8.0.4. or newer, NONE of the widgets work. Also not TagsInput. Nothing from the package seems to work, I get the error I posted before.

A virtual environment would not solve it, I believe?

I tried using SelectMultiple from ipywidgets, but since I need to choose from a very extensive list, and need a search function, it doesn't suit my needs, like described earlier.

I have not tried yet react-select or react-virtualized-select. I can try this, do you have any kind of documentation for such a multi-select widget with a search functionality?

Thank you

Anonymous
Not applicable

Hi @Tessa Ickx​ 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group