Skip to content

Cannot import make_subplots #5246

Open
Open
@ayclqt

Description

@ayclqt

When i import make_subplots, i got this error

py
Python 3.12.9 (main, Mar 31 2025, 00:00:00) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import plotly
>>> from plotly.subplots import make_subplots
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/linhtinh/.venv/lib64/python3.12/site-packages/plotly/subplots.py", line 26, in <module>
    ) -> go.Figure:
         ^^^^^^^^^
  File "/data/linhtinh/.venv/lib64/python3.12/site-packages/plotly/graph_objects/__init__.py", line 305, in __getattr__
    return orig_getattr(import_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/linhtinh/.venv/lib64/python3.12/site-packages/_plotly_utils/importers.py", line 37, in __getattr__
    return getattr(class_module, class_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/linhtinh/.venv/lib64/python3.12/site-packages/plotly/graph_objs/__init__.py", line 305, in __getattr__
    return orig_getattr(import_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/linhtinh/.venv/lib64/python3.12/site-packages/_plotly_utils/importers.py", line 36, in __getattr__
    class_module = importlib.import_module(rel_module, parent_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/linhtinh/.venv/lib64/python3.12/site-packages/plotly/graph_objs/_figure.py", line 4, in <module>
    from plotly.basedatatypes import BaseFigure
  File "/data/linhtinh/.venv/lib64/python3.12/site-packages/plotly/basedatatypes.py", line 21, in <module>
    from .optional_imports import get_module
ImportError: cannot import name 'get_module' from 'plotly.optional_imports' (/data/linhtinh/.venv/lib64/python3.12/site-packages/plotly/optional_imports.py)
>>> 

When I check optional_imports.py, there's nothing in it

Image
I'm using plotly 6.1.2

Metadata

Metadata

Assignees

Labels

P1needed for current cyclebugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions