문제

ft2build.h 여기에 있습니다 :

C : Program Files gnuwin32 포함

처음에는 여기와 같은 실수를했습니다.

치명적인 오류 C1083 : 열 수 없음 파일 포함 : 'Tiffio.h': 그러한 파일 또는 디렉토리 vc ++ 2008

그러나 그 이후로 해당 특정 오류를 수정했습니다 (위의 디렉토리를 "실행 파일"목록이 아닌 "포함"목록에 추가했지만 여전히 오류가 발생합니다. 전체 출력은 다음과 같습니다.

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

나는 이것이 Python 2.6이라고 언급해야한다

도움이 되었습니까?

해결책

프리 타입을 올바르게 설치 했습니까? 있으면 이름이 지정된 파일이 있어야합니다. ft2build.h 설치 디렉토리 아래 어딘가에 있으며 해당 파일이있는 디렉토리는 -I. "gnuwin32"문자열은 빌드 명령의 출력의 어느 곳에도 나타나지 않으므로 해당 디렉토리를 올바른 포함 목록에 배치하지 않은 것처럼 보입니다.

다른 팁

이 오류는 Ubuntu 10.10에서 Matplotlib을 구축 할 때도 발생합니다. 해결책은 다음과 같습니다.

sudo apt-get install python-dev libfreetype6-dev

Mac OS X의 또 다른 솔루션은 Homebrew로 프리 타입을 설치하는 것입니다.

brew install freetype

동일한 문제가있을 수 있지만 Mac OS 10.6 (Snow Leopard) 및 Python 2.7에서. , 내가 찾은 가장 쉬운 솔루션은 Numpy, Scipy 및 Matplotlib를 다운로드하고 컴파일하는 제작 파일을 얻는 것이 었습니다. make 파일을 사용자 정의하여 matplotlib 만 얻을 수 있습니다. 여기에 있습니다 링크 솔루션에.

Red Hat 6에서 같은 오류가있었습니다. 설치가 필요하다는 것이 밝혀졌습니다. freetype-devel, 아니다 freetype (사용 sudo yum install freetype-devel)

또한 Mac OS X에 Homebrew를 사용하여 Freetype을 설치 하여이 문제를 해결했습니다. 그러나 라이브러리가 Mac OS X 10.7에서 제대로 연결되지 않았기 때문에 충분하지 않았습니다. 그래서 수동으로 추가해야했습니다 pip 다음과 같이 명령 :

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 

폴더도 추가해야합니다 /usr/local/opt/freetype/include/freetype2, Homebrew 알림에 기본적으로 포함되지 않지만 찾을 수 없습니다. ft2build.h.

다음을 수행하여 Windows에서 이것을 해결할 수있었습니다.

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

Windows의 Freetype 용 링크 라이브러리는 여기에서 찾을 수 있습니다. http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib (Meawoppl의 의견에서)

"matplotlib-1.x -windows-link-libraries.zip"을 다운로드하고 zip에서 readme을 열기 만하면됩니다.

C 드라이브의 폴더로 파일을 다운로드하십시오. Windows CMD 프롬프트에서 관리자가 사용하는 경로를 탐색합니다.cd.. 또는 cd wheels (제 경우에는 파일을 저장했습니다 c:\Wheels) 그런 다음 입력하십시오 pip install YourFilename.whl

결과

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top