Matplotlib Construire Problème: Error C1083: Impossible d'ouvrir le fichier include: 'ft2build.h'
ft2build.h se trouve ici:
C:\Program Files\GnuWin32\include
D'abord, j'ai fait la même erreur que voici:
mais depuis, j'ai corrigé cette erreur (j'ai ajouté le répertoire ci-dessus pour les "include" de la liste, plutôt que de la "exécutables" de la liste), mais j'obtiens toujours une erreur. La production complète est: est-ce
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
Je dois mentionner que c'est la version 2.6 de Python
Vous devez vous connecter pour publier un commentaire.
Avez-vous installé freetype correctement? Si vous avez, il devrait y avoir un fichier nommé
ft2build.h
quelque part dans le répertoire d'installation, et le répertoire où le fichier est trouvé est celui que vous devez spécifier avec-I
. La chaîne "GnuWin32" n'apparaît nulle part dans la production de votre commande de construction, il semble que vous n'avez pas placé de ce répertoire dans la bonne liste d'inclusion.Cette erreur survient lors de la construction de matplotlib sur Ubuntu 10.10 aussi. La solution est de le faire:
Une autre solution pour Mac OS X est d'installer Freetype avec Homebrew.
Pour ceux qui pourraient avoir le même problème mais sur un Mac OS 10.6 (snow leopard) et Python 2.7. la solution la plus simple que j'ai trouvé était d'obtenir un fichier de téléchargement Numpy, scipy et matplotlib et de les compiler pour vous. Vous pouvez personnaliser le fichier de créer pour vous matplotlib seulement. Voici la lien à la solution.
J'ai eu le même message d'erreur dans red hat 6. S'avère que j'ai besoin d'installer
freetype-devel
, pasfreetype
(à l'aide desudo yum install freetype-devel
)J'ai aussi résolu ce problème en installant freetype à l'aide de homebrew sur Mac OS X. Cependant, cela n'était pas suffisant, que les bibliothèques n'étaient pas reliés correctement sous Mac OS X 10.7. J'ai donc dû les ajouter manuellement à
pip
commande comme suit:Notez que vous avez également ajouter le dossier
/usr/local/opt/freetype/include/freetype2
, ce qui n'est pas inclus par défaut sur le homebrew notification, mais ne pas trouverft2build.h
.J'ai été en mesure de résoudre ce sur Windows en procédant comme suit:
Les bibliothèques de liens pour Freetype sur windows peut être trouvé ici: http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib (à partir de meawoppl commentaire)
Il suffit de télécharger l' "matplotlib-1.x-windows-link-libraries.zip" et ouvrez le fichier README de l'archive zip.
Télécharger votre fichier dans un dossier sur votre disque C.
Dans windows invite de CMD en tant qu'Administrateur de naviguer votre chemin à l'aide de
cd..
oucd wheels
(dans mon cas, j'ai enregistré le fichier dec:\Wheels
)tapez
pip install YourFilename.whl
Résultats dans