2013-06-06 61 views
0

我在RHEL 5.9桌面上安装了Python 2.7的altinstall(python 2.4附带rhel5)。我已经成功安装了numpy1.7.1scipy-0.12.0。然而,当我尝试建立matplotlib1.2.1python2.7 setup.py build),我得到它,我无法调试安装matplotlib时出错-python2.7(RHEL 5.9)

============================================================================ 
BUILDING MATPLOTLIB 
      matplotlib: 1.2.1 
       python: 2.7.5 (default, May 16 2013, 15:45:29) [GCC 4.1.2 
         20080704 (Red Hat 4.1.2-54)] 
       platform: linux2 

REQUIRED DEPENDENCIES 
       numpy: 1.7.1 
      freetype2: found, but unknown version (no pkg-config) 
         * WARNING: Could not find 'freetype2' headers in any 
         * of '/usr/local/include', '/usr/include', 
         * '/usr/local/include', '/usr/include', '.', 
         * '/usr/local/include/freetype2', 
         * '/usr/include/freetype2', 
         * '/usr/local/include/freetype2', 
         * '/usr/include/freetype2', './freetype2'. 

OPTIONAL BACKEND DEPENDENCIES 
       libpng: found, but unknown version (no pkg-config) 
         * Could not find 'libpng' headers in any of 
         * '/usr/local/include', '/usr/include', 
         * '/usr/local/include', '/usr/include', '.' 
       Tkinter: Tkinter: 81008, Tk: 8.4, Tcl: 8.4 
        Gtk+: no 
         * Building for Gtk+ requires pygtk; you must be able 
         * to "import gtk" in your build/install environment 
     Mac OS X native: no 
        Qt: no 
        Qt4: no 
       PySide: no 
       Cairo: no 

OPTIONAL DATE/TIMEZONE DEPENDENCIES 
       dateutil: matplotlib will provide 
        pytz: matplotlib will provide 

OPTIONAL USETEX DEPENDENCIES 
       dvipng: 1.5 
      ghostscript: 8.70 
       latex: 3.141592 
       pdftops: 3.00 

[Edit setup.cfg to suppress the above messages] 
============================================================================ 
pymods ['pylab'] 
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.tri', 'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil.zoneinfo'] 
running build 
running build_py 
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-2.7/matplotlib/mpl-data 
running build_ext 
building 'matplotlib.ft2font' extension 
gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wall -g -O -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/local/lib/python2.7/site-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/local/include/python2.7 -c src/ft2font.cpp -o build/temp.linux-x86_64-2.7/src/ft2font.o 
In file included from src/ft2font.cpp:3: 
src/ft2font.h:16:22: error: ft2build.h: No such file or directory 
src/ft2font.h:17:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:18:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:19:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:20:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:21:10: error: #include expects "FILENAME" or <FILENAME> 
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728, 
       from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, 
       from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15, 
       from src/ft2font.cpp:7: 
/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" 
src/ft2font.h:34: error: ‘FT_Bitmap’ has not been declared 
src/ft2font.h:34: error: ‘FT_Int’ has not been declared 
src/ft2font.h:34: error: ‘FT_Int’ has not been declared 
src/ft2font.h:86: error: expected ‘,’ or ‘...’ before ‘&’ token 
src/ft2font.h:86: error: ISO C++ forbids declaration of ‘FT_Face’ with no type 
src/ft2font.h:132: error: ‘FT_Face’ does not name a type 
src/ft2font.h:133: error: ‘FT_Matrix’ does not name a type 
src/ft2font.h:134: error: ‘FT_Vector’ does not name a type 
src/ft2font.h:135: error: ‘FT_Error’ does not name a type 
src/ft2font.h:136: error: ‘FT_Glyph’ was not declared in this scope 
src/ft2font.h:136: error: template argument 1 is invalid 
src/ft2font.h:136: error: template argument 2 is invalid 
src/ft2font.h:137: error: ‘FT_Vector’ was not declared in this scope 
src/ft2font.h:137: error: template argument 1 is invalid 
src/ft2font.h:137: error: template argument 2 is invalid 
src/ft2font.h:143: error: ‘FT_BBox’ does not name a type 
src/ft2font.cpp:41: error: ‘FT_Library’ does not name a type 
src/ft2font.cpp:106: error: variable or field ‘draw_bitmap’ declared void 
src/ft2font.cpp:106: error: ‘int FT2Image::draw_bitmap’ is not a static member of ‘class FT2Image’ 
src/ft2font.cpp:106: error: ‘FT_Bitmap’ was not declared in this scope 
src/ft2font.cpp:106: error: ‘bitmap’ was not declared in this scope 
src/ft2font.cpp:107: error: ‘FT_Int’ was not declared in this scope 
src/ft2font.cpp:108: error: ‘FT_Int’ was not declared in this scope 
src/ft2font.cpp:108: error: initializer expression list treated as compound expression 
src/ft2font.cpp:109: error: expected ‘,’ or ‘;’ before ‘{’ token 
/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1594: warning: ‘int _import_array()’ defined but not used 
error: command 'gcc' failed with exit status 1 

我使用PIP-2.7时和easy_install的-2.7得到类似的错误消息以下错误消息。有任何想法吗?


继伊藩的建议,安装FreeType的-devel的,我得到一个新的错误日志

basedirlist is: ['/usr/local', '/usr'] 
============================================================================ 
BUILDING MATPLOTLIB 
      matplotlib: 1.2.1 
       python: 2.7.5 (default, May 16 2013, 15:45:29) [GCC 4.1.2 
         20080704 (Red Hat 4.1.2-54)] 
       platform: linux2 

REQUIRED DEPENDENCIES 
       numpy: 1.7.1 
      freetype2: 9.10.3 

OPTIONAL BACKEND DEPENDENCIES 
       libpng: found, but unknown version (no pkg-config) 
         * Could not find 'libpng' headers in any of 
         * '/usr/local/include', '/usr/include', 
         * '/usr/local/include', '/usr/include', '.' 
       Tkinter: Tkinter: 81008, Tk: 8.4, Tcl: 8.4 
        Gtk+: no 
         * Building for Gtk+ requires pygtk; you must be able 
         * to "import gtk" in your build/install environment 
     Mac OS X native: no 
        Qt: no 
        Qt4: no 
       PySide: no 
       Cairo: no 

OPTIONAL DATE/TIMEZONE DEPENDENCIES 
       dateutil: matplotlib will provide 
        pytz: matplotlib will provide 

OPTIONAL USETEX DEPENDENCIES 
       dvipng: 1.5 
      ghostscript: 8.70 
       latex: 3.141592 
       pdftops: 3.00 

[Edit setup.cfg to suppress the above messages] 
============================================================================ 
pymods ['pylab'] 
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.tri', 'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil.zoneinfo'] 
running build 
running build_py 
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-2.7/matplotlib/mpl-data 
running build_ext 
building 'matplotlib._png' extension 
gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wall -g -O -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I/usr/local/include -I/usr/include -I. -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I. -I/usr/local/include/python2.7 -c src/_png.cpp -o build/temp.linux-x86_64-2.7/src/_png.o 
src/_png.cpp:10:20: error: png.h: No such file or directory 
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728, 
       from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17, 
       from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15, 
       from src/_png.cpp:28: 
/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" 
src/_png.cpp:67: error: variable or field ‘write_png_data’ declared void 
src/_png.cpp:67: error: ‘png_structp’ was not declared in this scope 
src/_png.cpp:67: error: ‘png_bytep’ was not declared in this scope 
src/_png.cpp:67: error: ‘png_size_t’ was not declared in this scope 
src/_png.cpp:67: error: initializer expression list treated as compound expression 
src/_png.cpp:68: error: expected ‘,’ or ‘;’ before ‘{’ token 
/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1594: warning: ‘int _import_array()’ defined but not used 
src/_png.cpp:67: warning: ‘write_png_data’ defined but not used 
error: command 'gcc' failed with exit status 1 

回答

2

看起来像你的系统没有安装freetype-devel。 尝试

sudo yum install freetype-devel 

第一。

此外,您可能需要安装libpng-devel

sudo yum install libpng-devel 
+4

我也必须安装的libpng-devel的 – moadeep