From 8934285bccd081ae365a2e6ff97d0f2ac31bcf4f Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Fri, 3 Feb 2023 15:40:03 -0500 Subject: [PATCH] Update __init__.py --- packages/python/plotly/codegen/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/python/plotly/codegen/__init__.py b/packages/python/plotly/codegen/__init__.py index b57654ed06..af49097466 100644 --- a/packages/python/plotly/codegen/__init__.py +++ b/packages/python/plotly/codegen/__init__.py @@ -270,8 +270,8 @@ def perform_codegen(): if sys.version_info < (3, 7) or TYPE_CHECKING: try: import ipywidgets as _ipywidgets - from distutils.version import LooseVersion as _LooseVersion - if _LooseVersion(_ipywidgets.__version__) >= _LooseVersion("7.0.0"): + from packaging.version import Version as _Version + if _Version(_ipywidgets.__version__) >= _Version("7.0.0"): from ..graph_objs._figurewidget import FigureWidget else: raise ImportError() @@ -284,9 +284,9 @@ def __getattr__(import_name): if import_name == "FigureWidget": try: import ipywidgets - from distutils.version import LooseVersion + from packaging.version import Version - if LooseVersion(ipywidgets.__version__) >= LooseVersion("7.0.0"): + if Version(ipywidgets.__version__) >= Version("7.0.0"): from ..graph_objs._figurewidget import FigureWidget return FigureWidget