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

后端 未结 11 2536
广开言路
广开言路 2020-12-03 02:24

ft2build.h is located here:

C:\\Program Files\\GnuWin32\\include

Initially, I made the same mistake as here:

Fatal

11条回答
  •  天命终不由人
    2020-12-03 03:05

    I also fixed this problem by installing freetype using homebrew on Mac OS X. However, that was not sufficient, as the libraries were not linked properly under Mac OS X 10.7. So I had to manually add them to pip command as follows:

    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 
    

    Note that you also have to add the folder /usr/local/opt/freetype/include/freetype2, which is not included by default on the homebrew notification, but will result in not finding ft2build.h.

提交回复
热议问题