安装Matplotlib时出错:致命错误C1083 [英] Error in installing Matplotlib : fatal error C1083

查看:294
本文介绍了安装Matplotlib时出错:致命错误C1083的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am relatively new to Python coding and want to learn about statistics and data management in Python. For this I would like to install Matplotlib, which is giving me some issues.

我看到其他人也遇到了这个问题,但是我还没有完全理解如何解决它.

I see other people having this issue, but I have not fully understood how to fix it.

要安装我要使用

pip install matplotlib

我已安装以下规格

  • Windows 10
  • Python 3.8
  • Microsoft Studio 2019

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

The first error i got was to install Microsoft Studio, so I did that. I have also attempted to update pip

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:

推荐答案

您拥有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.

You have python 3.8, not python 3.7.
But there are no python 3.8 wheels available for matplotlib 3.1.1 on pypi. So best remove python 3.8 completely and install python 3.7.
When you then run python -m pip install matplotlib it will install the compiled version from the wheels, so there is no need to compile anything yourself or have Microsoft Studio available.

这篇关于安装Matplotlib时出错:致命错误C1083的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆