skip to Main Content

I recently installed the last version of matplotlib. As I try to import into Visual Studio Code I receive this error:

    ---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Untitled-2.ipynb Cella 1 in 1
----> 1 import matplotlib

File ~AppDataRoamingPythonPython310site-packagesmatplotlib__init__.py:109
    105 from packaging.version import parse as parse_version
    107 # cbook must import matplotlib only within function
    108 # definitions, so it is safe to import from it here.
--> 109 from . import _api, _version, cbook, docstring, rcsetup
    110 from matplotlib.cbook import MatplotlibDeprecationWarning, sanitize_sequence
    111 from matplotlib.cbook import mplDeprecation  # deprecated

File ~AppDataRoamingPythonPython310site-packagesmatplotlibdocstring.py:1
----> 1 from matplotlib._docstring import *  # noqa: F401, F403
      2 from matplotlib import _api
      3 _api.warn_deprecated(
      4     "3.6", obj_type='module', name=f"{__name__}")

ModuleNotFoundError: No module named 'matplotlib._docstring'

I used pip to install the library.

2

Answers


  1. Chosen as BEST ANSWER

    I solved by upgrading the Python version (from 3.10 to 3.11), pip version and matplotlib


    1. Ctrl+Shift+P

    2. Python: Select Interpreter

      enter image description here

    3. Select the interpreter that has matplotlib installed.

      enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search