安装Matplotlib时出错:致命错误C1083

发布于 2021-01-29 15:02:04

我对Python编码比较陌生,想了解Python中的统计信息和数据管理。为此,我想安装Matplotlib,这给了我一些问题。

我看到其他人有此问题,但是我还没有完全了解如何解决它。

要安装我使用

pip install matplotlib

我安装了以下规格

  • Windows 10
  • Python 3.8
  • Microsoft Studio 2019

我遇到的第一个错误是安装Microsoft Studio,所以我做到了。我也尝试更新点子

BUILDING MATPLOTLIB 
 matplotlib: yes [3.1.1] 
 python: yes [3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)]] 
 platform: yes [win32]

...

 checkdep_freetype2.c
    src/checkdep_freetype2.c(1): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1:
关注者
0
被浏览
130
1 个回答
  • 面试哥
    面试哥 2021-01-29
    为面试而生,有面试问题,就找面试哥。

    您拥有python 3.8,而不是python 3.7。
    但是在pypi上 没有适用于matplotlib 3.1.1的python 3.8轮子 。因此,最好完全删除python 3.8并安装python
    3.7。
    然后,当您运行时python -m pip install matplotlib,它将从轮子上安装已编译的版本,因此无需自己编译任何文件或使用Microsoft Studio。




知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看