2009-04-17 7 views
26

ft2build.h befindet sich hier:Matplotlib Build-Problem: Fehler C1083: kann nicht geöffnet werden Include-Datei: 'ft2build.h'

C: \ Programme \ GnuWin32 \ include

Anfänglich ich habe die gleichen Fehler wie hier:

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

aber seitdem habe ich korrigiert, dass bestimmte Fehler (ich habe das obige Verzeichnis in das „inkl hinzugefügt "Liste, anstatt die" ausführbaren Dateien "-Liste), aber ich bekomme immer noch einen Fehler. Die vollständige Ausgabe ist dies:

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 lib\matplotlib\mpl-data\matplotlibrc -> build\lib.win32-2.6\matplotlib\m 
pl-data 
copying lib\matplotlib\mpl-data\matplotlib.conf -> build\lib.win32-2.6\matplotli 
b\mpl-data 
running build_ext 
building 'matplotlib.ft2font' extension 
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 
3 /GS- /DNDEBUG -IC:\Python26\lib\site-packages\numpy\core\include -I. -IC:\Pyth 
on26\lib\site-packages\numpy\core\include\freetype2 -I.\freetype2 -IC:\Python26\ 
include -IC:\Python26\include\Stackless -IC:\Python26\PC /Tpsrc/ft2font.cpp /Fob 
uild\temp.win32-2.6\Release\src/ft2font.obj 
ft2font.cpp 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 
4530: C++ exception handler used, but unwind semantics are not enabled. Specify 
/EHsc 
c:\python26\lib\site-packages\matplotlib-0.98.5.2\src\ft2font.h(13) : fatal erro 
r C1083: Cannot open include file: 'ft2build.h': No such file or directory 
error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa 
iled with exit status 2 

Ich sollte erwähnen, dass diese Python 2.6

Antwort

14

Sie freetype richtig installiert? Wenn dies der Fall ist, sollte sich irgendwo im Installationsverzeichnis eine Datei mit dem Namen ft2build.h befinden, und das Verzeichnis, in dem diese Datei gefunden wird, sollte mit -I angegeben werden. Die Zeichenfolge "GnuWin32" wird nirgendwo in der Ausgabe Ihres Buildbefehls angezeigt. Es sieht also so aus, als hätten Sie dieses Verzeichnis nicht in der richtigen Einschlussliste platziert.

+0

Dank geben, ich am Ende der Suche und Das Verschieben von ft2build.h in ein Verzeichnis, von dem ich sicher war, würde eingeschlossen werden. –

+1

Wenn Sie Windows verwenden, sollten Sie vordefinierte Binärdateien verwenden. [Dieses Repository] (http://www.lfd.uci.edu/~gohlke/pythonlibs/) von inoffiziellen Binärdateien war ein Lebensretter für mich. – meawoppl

3

Für diejenigen, die das gleiche Problem haben könnten, aber auf einem Mac OS 10.6 (Schneeleopard) und Python 2.7. Die einfachste Lösung, die ich gefunden habe, war, eine make-Datei zu bekommen, die Numpy, scipy und matplotlib herunterlädt und für Sie kompiliert. Sie können die make-Datei anpassen, um nur matplotlib zu erhalten. Hier ist die link zur Lösung.

60

Dieser Fehler tritt beim Erstellen von Matplotlib auf Ubuntu 10.10 auch auf. Die Lösung ist zu tun:

sudo apt-get install python-dev libfreetype6-dev 
+8

Das OP ist auf Windows, also wahrscheinlich nicht zu hilfreich für ihn, aber +1 für die Hilfe bei der Sortierung auf meinem Rechner. –

3

hatte ich die gleichen Fehler im roten Hut 6. Es stellte sich heraus, dass ich brauchte freetype-devel zu installieren, nicht freetype (mit sudo yum install freetype-devel)

7

Eine andere Lösung für Mac OS X zu Installieren Sie Freetype mit Homebrew.

brew install freetype 
2

ich dieses Problem auch als die Bibliotheken nicht verbunden waren ordnungsgemäß unter Mac OS X 10.7 mit homebrew, war, dass jedoch unter Mac OS X durch die Installation von Freetype Fest nicht ausreichend. Also musste ich sie manuell zu pip Befehl hinzufügen wie folgt:

brew install freetype 
brew install libpng 
LDFLAGS="-L/usr/local/opt/freetype/lib -L/usr/local/opt/libpng/lib" CPPFLAGS="-I/usr/local/opt/freetype/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/include/freetype2" pip install matplotlib 

Beachten Sie, dass Sie auch den Ordner /usr/local/opt/freetype/include/freetype2 hinzufügen müssen, die nicht standardmäßig auf dem Homebrew-Mitteilung enthalten ist, aber führt nicht ft2build.h zu finden.

+0

danke! das hat bei mir auch am 10.9.5 funktioniert. – Jack

2

Ich konnte dies unter Windows lösen dem durch folgende Aktionen ausführen:

set INCLUDE=%INCLUDE%;C:\tmp\msvcr90-x32 
    set LIB=%LIB%;C:\tmp\msvcr90-x32 
    pip.exe install matplotlib 

Die Link-Bibliotheken für Freetype auf Windows finden Sie hier: http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib (von meawoppl Kommentar)

Laden Sie einfach die " matplotlib-1.x-windows-link-libraries.zip ", und öffnen Sie die README von der Zip.

0

Laden Sie Ihre Datei in einen Ordner auf Ihrem C-Laufwerk herunter. In Windows CMD-Eingabeaufforderung als Administrator Sie Ihren Weg cd.. oder cd wheels mit navigieren (in meinem Fall habe ich die Datei auf c:\Wheels gespeichert) dann pip install YourFilename.whl

Ergebnisse in

Processing c:\wheels\scipy-0.19.0-cp27-cp27m-win_amd64.whl 
Requirement already satisfied: numpy>=1.8.2 in c:\python27\lib\site-packages (from scipy==0.19.0) 
Installing collected packages: scipy 
Successfully installed scipy-0.19.0