Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

mrapacz
Copy link

@mrapacz mrapacz commented Aug 14, 2024

This addresses #3755

Resolution

This PR fixes the issue by defining dummy FloatSlider and IntSlider classes which do not raise exceptions when instantiated. This allows the patched @interact to handle the missing ipywidgets scenario gracefully.

After applying the changes suggested in this PR the ImportError is raised as intended.

$ python -c "import seaborn; seaborn.choose_colorbrewer_palette('quatlitative')"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<redacted>/seaborn/seaborn/widgets.py", line 141, in choose_colorbrewer_palette
    @interact
     ^^^^^^^^
  File "<redacted>/seaborn/seaborn/widgets.py", line 10, in interact
    raise ImportError(msg)
ImportError: Interactive palettes require `ipywidgets`, which is not installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant