Skip to content

[Bug]: AttributeError while trying to import matplotlib.pyplot #27289

Closed as not planned
@dhondta

Description

@dhondta

Bug summary

AttributeError while trying to import matplotlib.pyplot.

Code for reproduction

import matplotlib.pyplot

Actual outcome

$ python3
Python 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.11/site-packages/matplotlib/pyplot.py", line 66, in <module>
    from matplotlib.figure import Figure, FigureBase, figaspect
  File "/home/user/.local/lib/python3.11/site-packages/matplotlib/figure.py", line 43, in <module>
    from matplotlib import _blocking_input, backend_bases, _docstring, projections
  File "/home/user/.local/lib/python3.11/site-packages/matplotlib/projections/__init__.py", line 60, in <module>
    from mpl_toolkits.mplot3d import Axes3D
  File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/__init__.py", line 1, in <module>
    from .axes3d import Axes3D
  File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 45, in <module>
    class Axes3D(Axes):
  File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 723, in Axes3D
    set_zticklabels = _axis_method_wrapper(
                      ^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 56, in __init__
    doc = inspect.getdoc(getattr(maxis.Axis, method_name))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Axis' has no attribute '_set_ticklabels'. Did you mean: 'set_ticklabels'?

Expected outcome

$ python3
Python 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot
>>> 

Additional information

No response

Operating system

Ubuntu 22.04

Matplotlib Version

3.8.1

Matplotlib Backend

No response

Python version

3.11.6

Jupyter version

No response

Installation

pip

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