blackhao
blackhao

Reputation: 53

ImportError: DLL load failed while importing _path: The specified module could not be found

When I was trying to import matplotlib, I wrote

import matplotlib.pyplot as plt

in my code. and this error occured.

Traceback (most recent call last):
  File "C:\aiProjects\opencv\test.py", line 2, in <module>
    import matplotlib.pyplot as plt
  File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\__init__.py", line 113, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\colors.py", line 56, in <module>
    from matplotlib import _api, _cm, cbook, scale
  File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\scale.py", line 22, in <module>
    from matplotlib.ticker import (
  File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\ticker.py", line 138, in <module>
    from matplotlib import transforms as mtransforms
  File "C:\Users\blackhao\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\transforms.py", line 49, in <module>
    from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.

Process finished with exit code 1

I tried several ways such as reinstalling matplotlib and pasting new "Msvcp71.dll" and "Msvcr71.dll" files in my system folders. Anyways to solve this problem?

Upvotes: 5

Views: 1437

Answers (1)

... reinstall the matplotlib python package with this argument --ignore-installed:

pip3 install matplotlib --user --ignore-installed

Upvotes: 4

Related Questions