Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
356 views
in Technique[技术] by (71.8m points)

python - Matplotlib Build Problem: Error C1083: Cannot open include file: 'ft2build.h'

ft2build.h is located here:

C:Program FilesGnuWin32include

Initially, I made the same mistake as here:

Fatal Error C1083: Cannot Open Include file: 'tiffio.h': No such file or directory VC++ 2008

but since then, I've corrected that particular error (I've added the above directory to the "include" list, rather than the "executables" list), but I still get an error. The complete output is this:

BUILDING MATPLOTLIB
            matplotlib: 0.98.5.2
                python: 2.6.2 Stackless 3.1b3 060516 (release26-maint, Apr
                        14 2009, 21:19:36) [MSC v.1500 32 bit (Intel)]
              platform: win32
       Windows version: (5, 1, 2600, 2, 'Service Pack 3')

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

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)
                        * Could not find 'libpng' headers in any of '.'
               Tkinter: no
                        * No tk/win32 support for this python version yet
              wxPython: 2.8.9.2
                        * WxAgg extension not required for wxPython >= 2.8
                  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
                 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
              datetime: present, version unknown
              dateutil: matplotlib will provide
                  pytz: matplotlib will provide

OPTIONAL USETEX DEPENDENCIES
                dvipng: no
           ghostscript: no
                 latex: no
               pdftops: no

[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections', 'mpl_to
olkits', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma
', 'matplotlib.numerix.npyma', 'matplotlib.numerix.linear_algebra', 'matplotlib.
numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.delaunay', 'pytz',
'dateutil', 'dateutil/zoneinfo']
running build
running build_py
copying libmatplotlibmpl-datamatplotlibrc -> buildlib.win32-2.6matplotlibm
pl-data
copying libmatplotlibmpl-datamatplotlib.conf -> buildlib.win32-2.6matplotli
bmpl-data
running build_ext
building 'matplotlib.ft2font' extension
C:Program FilesMicrosoft Visual Studio 9.0VCBINcl.exe /c /nologo /Ox /MD /W
3 /GS- /DNDEBUG -IC:Python26libsite-packages
umpycoreinclude -I. -IC:Pyth
on26libsite-packages
umpycoreincludefreetype2 -I.freetype2 -IC:Python26
include -IC:Python26includeStackless -IC:Python26PC /Tpsrc/ft2font.cpp /Fob
uildemp.win32-2.6Releasesrc/ft2font.obj
ft2font.cpp
C:Program FilesMicrosoft Visual Studio 9.0VCINCLUDExlocale(342) : warning C
4530: C++ exception handler used, but unwind semantics are not enabled. Specify
/EHsc
c:python26libsite-packagesmatplotlib-0.98.5.2srcft2font.h(13) : fatal erro
r C1083: Cannot open include file: 'ft2build.h': No such file or directory
error: command '"C:Program FilesMicrosoft Visual Studio 9.0VCBINcl.exe"' fa
iled with exit status 2

I should mention that this is Python 2.6

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This error comes about when building matplotlib on Ubuntu 10.10 also. The solution is to do:

sudo apt-get install python-dev libfreetype6-dev

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...