在fedora 19上从源代码构建matplotlib,发现没有freetype头文件

时间:2014-01-12 16:58:54

标签: python linux matplotlib freetype

我在fedora 19系统上安装了matplotlib源包,并获得了以下信息:

============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
    matplotlib: yes [1.3.1]
        python: yes [2.7.6 (default, Jan  9 2014, 14:24:42)  [GCC
                4.8.1 20130603 (Red Hat 4.8.1-1)]]`
      platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
         numpy: yes [version 1.8.0]
      dateutil: yes [dateutil was not found. It is required for date
                     axis support. pip/easy_install may attempt to
                     install it after matplotlib.]
       tornado: yes [tornado was not found. It is required for the
                WebAgg backend. pip/easy_install may attempt to
                install it after matplotlib.]
     pyparsing: yes [pyparsing was not found. It is required for
                mathtext support. pip/easy_install may attempt to
                install it after matplotlib.]
         pycxx: yes [Couldn't import.  Using local copy.]
        libagg: yes [pkg-config information for 'libagg' could not
                be found. Using local copy.]
      freetype: no  [The C/C++ header for freetype2 (ftbuild.h)
                could not be found. You may need to install the
                development package.]
           png: yes [pkg-config information for 'libpng' could not
                be found. Using unknown version.]

OPTIONAL SUBPACKAGES
   sample_data: yes [installing]
      toolkits: yes [installing]
         tests: yes [using nose version 1.3.0]

OPTIONAL BACKEND EXTENSIONS
        macosx: no  [Mac OS-X only]
        qt4agg: no  [PyQt4 not found]
       gtk3agg: no  [Requires pygobject to be installed.]
     gtk3cairo: no  [Requires cairo to be installed.]
        gtkagg: no  [Requires pygtk.]
         tkagg: no  [TKAgg requires Tkinter.]
         wxagg: no  [requires wxPython]
           gtk: no  [The C/C++ header for gtk (gtk/gtk.h) could not
                be found.  You may need to install the development
                package.]
           agg: yes [installing]
         cairo: no  [cairo not found]
     windowing: no  [Microsoft Windows only]

OPTIONAL LATEX DEPENDENCIES
        dvipng: yes [version 1.14]
   ghostscript: yes [version 9.07]
         latex: no
       pdftops: yes [version 0.22.1]

============================================================================
                * The following required packages can not be built:
                * freetype

但是,在此安装之前,我已经在默认目录中安装了freetype 2.5.2,即/usr/local。我在ft2build.h中找到了头文件(/usr/local/include/freetype2)。还会检查setupext.pyclass FreeType(SetupPackage)的代码部分中有

the default_include_dirs=
          ['freetype2','lib/freetype2/include','lib/freetype2/include/freetype2',]

现在,我不知道为什么包找不到已安装的freetype。有人有想法吗?谢谢你的帮助!!!

3 个答案:

答案 0 :(得分:1)

我有完全相同的问题。我解决了它只是在setupext.py的self._check_for_pkg_config()中用ft2build.h的整个路径替换'ft2build.h'(由tcaswell提出)。

答案 1 :(得分:0)

感谢您的帮助!

是的,我手动安装所有这些软件包,因为我的Linux系统电脑不能连接到互联网。

在我找到您的回复之前,我已经以间接的方式解决了问题;-(,这就是我所做的:

因为freetype 2.5.2的devel包对我的fedora 19系统不方便,所以我不得不选择使用freetype 2.4.11-6及其devel包,现在依赖性还可以。我个人怀疑这是环境路径设置的问题,但我当时没有时间测试它。实际上,freetype 2.5.2的源包已经包含了devel子目录。

顺便说一下,matplotlib的手动安装很复杂,排除了必须的包:libpng和numpy,你还需要安装distribute,backports.ssl_match_hostname,tornado,six,dateutil和pyparsing。只有在所有这些安装结束后,matplotlib才能最终安装在您的系统中。

答案 2 :(得分:0)

在Windows 7上的cygwin 64上使用pip install:在安装pkg-config后解决了同样的问题。