matplotlib安装问题
前面决定向盐汤学习。在Ubuntu下安装nltk一切正常,安装numpy也正常。但是在安装matplotlib包的时候报错。
wokao@wokao-desktop:~/下载$ sudo python setup.py install
[sudo] password for wokao:
python: can't open file 'setup.py': [Errno 2] No such file or directory
wokao@wokao-desktop:~/下载$ cd matplotlib-1.0.1/
wokao@wokao-desktop:~/下载/matplotlib-1.0.1$ sudo python setup.py install
basedirlist is: ['/usr/local', '/usr']
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.0.1
python: 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC
4.4.3]
platform: linux2
REQUIRED DEPENDENCIES
numpy: 1.5.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/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', '.'
Tkinter: no
* TKAgg requires Tkinter
wxPython: no
* wxPython not found
pkg-config: looking for pygtk-2.0 gtk+-2.0
* Package pygtk-2.0 was not found in the pkg-config
* search path. Perhaps you should add the directory
* containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
* environment variable No package 'pygtk-2.0' found
* Package gtk+-2.0 was not found in the pkg-config
* search path. Perhaps you should add the directory
* containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH
* environment variable No package 'gtk+-2.0' found
* You may need to install 'dev' package(s) to
* provide header files.
Gtk+: no
* Could not find Gtk+ headers in any of
* '/usr/local/include', '/usr/include', '.'
Mac OS X native: no
Qt: no
Qt4: no
Cairo: 1.8.8
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: 1.4.1
pytz: 2010b
OPTIONAL USETEX DEPENDENCIES
dvipng: no
ghostscript: 8.71
latex: no
pdftops: 0.12.4
[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.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.tri', 'matplotlib.delaunay']
running install
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-i686-2.6/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/lib.linux-i686-2.6/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/lib/python2.6/dist-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/local/lib/python2.6/dist-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/include/python2.6 -c src/ft2font.cpp -o build/temp.linux-i686-2.6/src/ft2font.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from src/ft2font.cpp:1:
src/ft2font.h:14:22: error: ft2build.h: 没有那个文件或目录
src/ft2font.h:15:10: error: #include expects "FILENAME" or <FILENAME>
src/ft2font.h:16:10: error: #include expects "FILENAME" or <FILENAME>
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>
In file included from src/ft2font.cpp:1:
src/ft2font.h:33: error: ‘FT_Bitmap’ has not been declared
src/ft2font.h:33: error: ‘FT_Int’ has not been declared
src/ft2font.h:33: error: ‘FT_Int’ has not been declared
src/ft2font.h:89: error: ISO C++ forbids declaration of ‘FT_Face’ with no type
src/ft2font.h:89: error: expected ‘,’ or ‘...’ before ‘&’ token
src/ft2font.h:95: error: ISO C++ forbids declaration of ‘FT_Face’ with no type
src/ft2font.h:95: error: expected ‘,’ or ‘...’ before ‘&’ token
src/ft2font.h:137: error: ‘FT_Face’ does not name a type
src/ft2font.h:138: error: ‘FT_Matrix’ does not name a type
src/ft2font.h:139: error: ‘FT_Vector’ does not name a type
src/ft2font.h:140: error: ‘FT_Error’ does not name a type
src/ft2font.h:141: error: ‘FT_Glyph’ was not declared in this scope
src/ft2font.h:141: error: template argument 1 is invalid
src/ft2font.h:141: error: template argument 2 is invalid
src/ft2font.h:142: error: ‘FT_Vector’ was not declared in this scope
src/ft2font.h:142: error: template argument 1 is invalid
src/ft2font.h:142: error: template argument 2 is invalid
src/ft2font.h:148: error: ‘FT_BBox’ does not name a type
src/ft2font.cpp:45: error: ‘FT_Library’ does not name a type
src/ft2font.cpp:108: error: variable or field ‘draw_bitmap’ declared void
src/ft2font.cpp:108: error: ‘FT_Bitmap’ was not declared in this scope
src/ft2font.cpp:108: error: ‘bitmap’ was not declared in this scope
src/ft2font.cpp:109: error: ‘FT_Int’ was not declared in this scope
src/ft2font.cpp:110: error: ‘FT_Int’ was not declared in this scope
/usr/local/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:1187: warning: ‘int _import_array()’ defined but not used
error: command 'gcc' failed with exit status 1
尝试重新搭建依存关系,输入命令: sudo apt-get build-dep matplotlib
提示要下载五百多M的包,正在下载中...
此处立文mark一下。
经过漫长的下载,安装,测试,一切正常。
wokao@wokao-desktop:~/下载$ sudo python setup.py install
[sudo] password for wokao:
python: can't open file 'setup.py': [Errno 2] No such file or directory
wokao@wokao-desktop:~/下载$ cd matplotlib-1.0.1/
wokao@wokao-desktop:~/下载/matplotlib-1.0.1$ sudo python setup.py install
basedirlist is: ['/usr/local', '/usr']
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.0.1
python: 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC
4.4.3]
platform: linux2
REQUIRED DEPENDENCIES
numpy: 1.5.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/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', '.'
Tkinter: no
* TKAgg requires Tkinter
wxPython: no
* wxPython not found
pkg-config: looking for pygtk-2.0 gtk+-2.0
* Package pygtk-2.0 was not found in the pkg-config
* search path. Perhaps you should add the directory
* containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
* environment variable No package 'pygtk-2.0' found
* Package gtk+-2.0 was not found in the pkg-config
* search path. Perhaps you should add the directory
* containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH
* environment variable No package 'gtk+-2.0' found
* You may need to install 'dev' package(s) to
* provide header files.
Gtk+: no
* Could not find Gtk+ headers in any of
* '/usr/local/include', '/usr/include', '.'
Mac OS X native: no
Qt: no
Qt4: no
Cairo: 1.8.8
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: 1.4.1
pytz: 2010b
OPTIONAL USETEX DEPENDENCIES
dvipng: no
ghostscript: 8.71
latex: no
pdftops: 0.12.4
[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.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.tri', 'matplotlib.delaunay']
running install
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-i686-2.6/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/lib.linux-i686-2.6/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/lib/python2.6/dist-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/local/lib/python2.6/dist-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/include/python2.6 -c src/ft2font.cpp -o build/temp.linux-i686-2.6/src/ft2font.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from src/ft2font.cpp:1:
src/ft2font.h:14:22: error: ft2build.h: 没有那个文件或目录
src/ft2font.h:15:10: error: #include expects "FILENAME" or <FILENAME>
src/ft2font.h:16:10: error: #include expects "FILENAME" or <FILENAME>
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>
In file included from src/ft2font.cpp:1:
src/ft2font.h:33: error: ‘FT_Bitmap’ has not been declared
src/ft2font.h:33: error: ‘FT_Int’ has not been declared
src/ft2font.h:33: error: ‘FT_Int’ has not been declared
src/ft2font.h:89: error: ISO C++ forbids declaration of ‘FT_Face’ with no type
src/ft2font.h:89: error: expected ‘,’ or ‘...’ before ‘&’ token
src/ft2font.h:95: error: ISO C++ forbids declaration of ‘FT_Face’ with no type
src/ft2font.h:95: error: expected ‘,’ or ‘...’ before ‘&’ token
src/ft2font.h:137: error: ‘FT_Face’ does not name a type
src/ft2font.h:138: error: ‘FT_Matrix’ does not name a type
src/ft2font.h:139: error: ‘FT_Vector’ does not name a type
src/ft2font.h:140: error: ‘FT_Error’ does not name a type
src/ft2font.h:141: error: ‘FT_Glyph’ was not declared in this scope
src/ft2font.h:141: error: template argument 1 is invalid
src/ft2font.h:141: error: template argument 2 is invalid
src/ft2font.h:142: error: ‘FT_Vector’ was not declared in this scope
src/ft2font.h:142: error: template argument 1 is invalid
src/ft2font.h:142: error: template argument 2 is invalid
src/ft2font.h:148: error: ‘FT_BBox’ does not name a type
src/ft2font.cpp:45: error: ‘FT_Library’ does not name a type
src/ft2font.cpp:108: error: variable or field ‘draw_bitmap’ declared void
src/ft2font.cpp:108: error: ‘FT_Bitmap’ was not declared in this scope
src/ft2font.cpp:108: error: ‘bitmap’ was not declared in this scope
src/ft2font.cpp:109: error: ‘FT_Int’ was not declared in this scope
src/ft2font.cpp:110: error: ‘FT_Int’ was not declared in this scope
/usr/local/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:1187: warning: ‘int _import_array()’ defined but not used
error: command 'gcc' failed with exit status 1
尝试重新搭建依存关系,输入命令: sudo apt-get build-dep matplotlib
提示要下载五百多M的包,正在下载中...
此处立文mark一下。
经过漫长的下载,安装,测试,一切正常。
还没人转发这篇日记