Matplotlib kiwisolver导入问题_cext

wvyml7n5  于 2023-04-07  发布在  其他
关注(0)|答案(1)|浏览(423)

我在运行我的脚本时遇到以下错误。我尝试卸载matplotlib并重新安装它,对于kiwisolver也是如此。我使用的是python3.11.2

import matplotlib.pyplot as plt
  File "c:\Users\XXXX\Downloads\XXXX\XXXX\.venv\Lib\site-packages\matplotlib\__init__.py", line 246, in <module>
    _check_versions()
  File "c:\Users\XXXX\Downloads\XXXXX\XXXX\.venv\Lib\site-packages\matplotlib\__init__.py", line 240, in _check_versions
    module = importlib.import_module(modname)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\XXX\Downloads\XXXX\XXXX\.venv\Lib\site-packages\kiwisolver\__init__.py", line 8, in <module>
    from ._cext import (
ImportError: DLL load failed while importing _cext: The specified module could not be found.
qaxu7uf2

qaxu7uf21#

我已经找到了解决方案,打开windows powershell并安装:

pip install msvc-runtime

相关问题