Skip to content

Plotly 5.13.1 introduces undeclared dependency to 'packaging' #4119

Closed
@gabcarray

Description

@gabcarray

Plotly 5.13.1 introduces a new dependency to the library 'packaging' without declaring it in environment.yml, which leads to crashes when running go.Figure.show(), unless packaging is installed externally.

This was discovered in python 3.8 in windows.

Snippet for reproduction:

pip install plotly==5.13.1
import plotly.graph_objects as go

def main():
    fig = go.Figure()
    fig.show()


if __name__ == "__main__":
    main()

Error message:

Traceback (most recent call last):
  File "CENSORED_PATH", line 9, in <module>
    main()
  File "CENSORED_PATH.py", line 5, in main
    fig.show()
  File "CENSORED_PATH\plotly\basedatatypes.py", line 3390, in show
    return pio.show(self, *args, **kwargs)
  File "CENSORED_PATH\_plotly_utils\importers.py", line 36, in __getattr__
    class_module = importlib.import_module(rel_module, parent_name)
  File "CENSORED_PATH\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "CENSORED_PATH\plotly\io\_renderers.py", line 7, in <module>
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging'

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