2014-01-12 47 views
1

我已經安裝在Fedora 19系統上matplotlib源碼包,並得到了以下信息:從源頭上的Fedora 19構建matplotlib,並沒有發現FreeType的頭文件

============================================================================ 
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。我在/usr/local/include/freetype2找到頭文件(ft2build.h)。該setupext.py也檢查,在class FreeType(SetupPackage)代碼部分,有

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

,我不知道爲什麼包找不到安裝的FreeType。有人有一些想法嗎?感謝你的幫助!!!

+0

你是通過百勝還是手工安裝? – tacaswell

+0

,在我的系統上,頭文件安裝在'/ usr/lib'中。我懷疑你手動安裝了freetype安裝。你或者需要使用打包的開發版本,或者你實際安裝的freetype路徑到目錄列表(強烈懷疑它們都是'/ usr') – tacaswell

+0

另外請注意,Fedora的'freetype-devel'包安裝頭文件放到/ usr/local/include中的'/ usr/include'(https://apps.fedoraproject.org/packages/freetype-devel/)。 – tacaswell

回答

1

我有完全相同的問題。我解決了這個問題,只需在self._check_for_pkg_config()的setupext.py中用ft2build.h的整個路徑替代'ft2build.h'(由tcaswell創建)即可。

0

感謝您的幫助!

是的,我手動安裝所有這些軟件包,因爲我的電腦與Linux系統donot連接到互聯網。

之前,我發現你的回答道:我已經解決了以間接的方式;-(問題,這裏是我做了什麼:

因爲devel包的FreeType 2.5.2不便於我的Fedora 19系統,所以我不得不選擇使用freetype 2.4.11-6及其開發包,依賴性現在可以,我個人懷疑這是一個環境路徑設置的問題,但我沒有時間在那個時候測試它實際上,freetype 2.5.2的源碼包已經包含了devel子目錄

順便說一句,matplotlib的手動安裝很複雜,排除必須的包:libpng和numpy,你仍然需要安裝distributed ,backports.ssl_match_hostname,龍捲風,六,dateutil和pyparsing。只有在所有這些安裝完成後,matplotlib才能最終安裝到您的系統中。

+0

是的,matplotlib有很多外部依賴。應該有一種簡單的方法可以關閉webagg,所以不需要龍捲風,但是'''''''''''''''''''''''''''''' http://matplotlib.org/users/installing.html可能需要更新。 – tacaswell

0

在Windows 7上使用pip install的cygwin 64上的同樣問題:安裝pkg-config後解決。