python - matplotlib fatal error ft2

标签 python windows matplotlib installation

我在Windows 7上安装了pythonxy,运行后出现错误

from pylab import * 

这似乎来自 matplotlib,连接到 ft2font 模块。我试图通过从 https://pypi.python.org/pypi/matplotlib/1.1.0 下载它来重新安装 matplotlib并运行

python setup.py install 

安装中止并显示消息

In file included from src/ft2font.cpp:3:0:
src/ft2font.h:16:22: fatal error: ft2build.h: No such file or directory
#include <ft2build.h>
                  ^
compilation terminated.
error: command 'gcc' failed with exit status 1

有人可以帮我解决这个问题吗?

编辑:下面的答案可能仍然对某些人有帮助(对我来说,发生了更多错误,最后我安装了 Oracle Virtual Box。现在我在 Virtual Box 中运行 Ubuntu,一切正常:))

最佳答案

您需要为“freetype2”安装开发库,这取决于您如何配置本地环境。

这里有更详细的解释;

http://gnuwin32.sourceforge.net/packages/freetype.htm

http://www.freetype.org/download.html

这里似乎也回答了类似的问题;

Visual studio 2010 no such file

然而,这可能是一个棘手的过程,matplotlib 建议 Windows 用户使用 Python 的“Enthought Edition”,其中预装了许多此类软件包;

http://matplotlib.org/users/installing.html#installing-on-windows

关于python - matplotlib fatal error ft2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22043037/

相关文章:

python - 使用 skimage 导入过滤器时出现问题

windows - 由于错误 : cannot find module 'liftoff' ,无法运行 grunt 命令

Windows 批处理 : Unicode parameters for (robo) copy command

使用正确的显示名称创建 C++ 编码文件

python - matplotlib 和 cartopy 的 tight_layout 问题

python - 不使用 `show()` 的 Matplotlib 事件处理

python - 捕获溢出错误

python - 如何在类中声明装饰器来装饰已经装饰的继承方法?

python - 使用 matplotlib 的多线图中不重复的颜色

python - coverity构建工具没有分析选项。 "cov-analyze"丢失