ImportError
Cell In[5], line 5
3 import pandas as pd
4 import numpy as np
----> 5 import matplotlib.pyplot as plt
6 import statsmodels.api as sm
File c:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\matplotlib\__init__.py:272
267 if parse_version(module.__version__) < parse_version(minver):
268 raise ImportError(f"Matplotlib requires {modname}>={minver}; "
269 f"you have {module.__version__}")
--> 272 _check_versions()
275 # The decorator ensures this always returns the same handler (and it is only
276 # attached once).
277 @functools.cache
278 def _ensure_handler():
File c:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\matplotlib\__init__.py:266, in _check_versions()
257 from . import ft2font
259 for modname, minver in [
260 ("cycler", "0.10"),
261 ("dateutil", "2.7"),
(...)
264 ("pyparsing", "2.3.1"),
265 ]:
--> 266 module = importlib.import_module(modname)
267 if parse_version(module.__version__) < parse_version(minver):
268 raise ImportError(f"Matplotlib requires {modname}>={minver}; "
269 f"you have {module.__version__}")
File c:\Users\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py:90, in import_module(name, package)
88 break
89 level += 1
---> 90 return _bootstrap._gcd_import(name[level:], package, level)
File c:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\kiwisolver\__init__.py:8
1 # --------------------------------------------------------------------------------------
2 # Copyright (c) 2013-2022, Nucleic Development Team.
3 #
(...)
6 # The full license is in the file LICENSE, distributed with this software.
7 # --------------------------------------------------------------------------------------
----> 8 from ._cext import (
9 Constraint,
10 Expression,
11 Solver,
12 Term,
13 Variable,
14 __kiwi_version__,
15 __version__,
16 strength,
17 )
18 from .exceptions import (
19 BadRequiredStrength,
20 DuplicateConstraint,
(...)
24 UnsatisfiableConstraint,
25 )
27 __all__ = [
28 "BadRequiredStrength",
29 "DuplicateConstraint",
(...)
41 "__kiwi_version__",
42 ]
ImportError: DLL load failed while importing _cext:
I reinstalled matplotlib, but nothing changed. Installed the latest version of Microsoft Visual C++. No changes.
I also tried to uninstall and reinstall matplotlib. Everything proceeds without errors. But there is still a problem with importing the module.
I also tried installing an earlier version of matlotlib 3.8.1, but it did not help.
New contributor
FatMongoose is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1