Python技巧:气死了,死活找不到模块,终于搞定了:ImportError: DLL load failed while importing _cext: 找不到指定的模块。

Python导入matplotlib 出现这个错误:

>>> import matplotlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\86180\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\__init__.py", line 263, in <module>
    _check_versions()
  File "C:\Users\86180\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\__init__.py", line 257, in _check_versions
    module = importlib.import_module(modname)
  File "C:\Users\86180\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\86180\AppData\Local\Programs\Python\Python39\lib\site-packages\kiwisolver\__init__.py", line 8, in <module>
    from ._cext import (
ImportError: DLL load failed while importing _cext: 找不到指定的模块。

试了各种办法,重新安装python, pip,matplotlib,kiwisolver都不管用。 气死了,死活找不到模块,最终重新安装Microsoft Visual C++ Redistributable,终于解决问题!

https://aka.ms/vs/17/release/vc_redist.x64.exe

作者:Ankie(资深技术项目经理)

物联沃分享整理
物联沃-IOTWORD物联网 » Python技巧:气死了,死活找不到模块,终于搞定了:ImportError: DLL load failed while importing _cext: 找不到指定的模块。

发表回复