Skip to content

ImportError with Plotly 7.0.0: create_distplot was removed from plotly.figure_factory #384

Description

@karrmagadgeteer2

Describe the bug
openseries 2.1.9 cannot be imported when Plotly 7.0.0 is installed. _common_model.py imports create_distplot from plotly.figure_factory at module load time, but that function was removed in Plotly 7.

The declared dependency is plotly>=5.18.0 with no upper bound, so a fresh install (or lockfile update) now resolves Plotly 7.0.0 and the package fails before any openseries API is used.

To Reproduce

  1. Install openseries==2.1.9 with plotly==7.0.0 (for example via pip install openseries plotly after Plotly 7.0.0 was released).
  2. Run:
from openseries import OpenTimeSeries

Expected behavior
openseries imports successfully, and plot_histogram(..., plot_type="lines") still works.

Actual behavior

ImportError: cannot import name 'create_distplot' from 'plotly.figure_factory'

Traceback:

File ".../openseries/__init__.py", line 13, in <module>
    from .frame import OpenFrame
File ".../openseries/frame.py", line 52, in <module>
    from ._common_model import _calculate_time_factor, _CommonModel, _get_base_column_data
File ".../openseries/_common_model.py", line 61, in <module>
    from plotly.figure_factory import create_distplot
ImportError: cannot import name 'create_distplot' from 'plotly.figure_factory'

Environment

  • openseries 2.1.9
  • plotly 7.0.0
  • Python 3.14 (also expected on 3.11–3.13)
  • macOS

Additional Information
Plotly 7.0.0 (released 2026-08-25) removed several deprecated Figure Factory helpers, including create_distplot:
https://github.com/plotly/plotly.py/releases/tag/v7.0.0

The import is here:

https://github.com/CaptorAB/openseries/blob/master/openseries/_common_model.py#L61

It is used in plot_histogram when plot_type == "lines":

https://github.com/CaptorAB/openseries/blob/master/openseries/_common_model.py#L1440

Suggested fixes:

  1. Cap the dependency immediately: plotly>=5.18.0,<7.
  2. Replace create_distplot with a Plotly Express / graph-objects equivalent (Plotly recommends plotly.express.histogram with marginal="rug").
  3. Optionally lazy-import the plotting helper so a Plotly 7 install does not break from openseries import OpenTimeSeries even before plot_histogram is called.

Until this is released, downstream projects can work around it with plotly>=5.18.0,<7.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions