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

后端 未结 11 2517
广开言路
广开言路 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:02

    Another solution for Mac OS X is to install Freetype with Homebrew.

    brew install freetype
    
    0 讨论(0)
  • 2020-12-03 03:04

    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
    
    0 讨论(0)
  • 2020-12-03 03:04

    I had the same issue with the jetson nano (aarch64-linux-gnu). this worked for me -

    sudo apt-get install python-dev libfreetype6-dev
    pip3 install --upgrade cyton
    pip3 install matplotlib
    
    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-03 03:09

    For those who might have the same issue but on a Mac OS 10.6 (snow leopard) and Python 2.7. , the easiest solution I found was to get a make file which downloads Numpy, scipy and matplotlib and compile them for you. You can customize the make file to get you matplotlib only. Here is the link to the solution.

    0 讨论(0)
  • 2020-12-03 03:12

    Download your file to a folder on your C drive. In windows CMD prompt as Administrator navigate you your path using cd.. or cd wheels (in my case I saved the file to c:\Wheels) then type pip install YourFilename.whl

    Results 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
    
    0 讨论(0)
提交回复
热议问题