【问题标题】:import error while running a program in python the following error message occurred在python中运行程序时导入错误出现以下错误消息
【发布时间】:2021-04-17 05:42:56
【问题描述】:

在 python 中运行程序时出现以下错误消息。

Traceback(最近一次调用最后一次):文件 "C:\Users\Student\AppData\Local\Programs\Python\Python38-32\python\cos.py", 第 7 行,在 将 matplotlib.pyplot 作为 plt 文件导入 "C:\Users\Student\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib_init_.py", 第 174 行,在 check_versions() 文件 "C:\Users\Student\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib_init.py", 第 159 行,在 _check_versions 从 。 import ft2font ImportError: DLL load failed while importing ft2font: 找不到指定的模块。

【问题讨论】:

标签: python windows


【解决方案1】:

此错误信息表示(f2tfont.cpp 无法编译) 首先

pip uninstall matplotlib 
pip install -U matplotlib==3.2.0rc1

如果不成功

您的系统中需要有 Visual Studio c++。

使用 c++ 发行版安装 Visual Studio 2019。

我希望这能解决你的错误

【讨论】:

    猜你喜欢
    • 2014-06-07
    • 2019-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多