Can't compile matplotlib on Ubuntu 11.04 / ft2build.h: No such file or directory

13,514

Solution 1

I found these dependencies in the install file:

  matplotlib core: zlib, zlib-devel, libpng, libpng-devel,
                   freetype, freetype-devel, freetype-utils

  gtk backend: gtk2-devel, gtk+-devel, pygtk2, glib-devel,
               pygtk2-devel, gnome-libs-devel, pygtk2-libglade

  tk backend: tcl, tk, tkinter

Do you have all those installed?

Solution 2

I should install libfreetype-dev (Ubuntu).

Solution 3

For RHEL use below command :

yum install freetype-devel -y

For Ubuntu use below command:

apt-get install libfreetype-dev -y
Share:
13,514

Related videos on Youtube

ruh roh
Author by

ruh roh

Updated on September 18, 2022

Comments

  • ruh roh
    ruh roh 4 months

    I'm trying to build matplotlib from source but it isn't working. It seems this thing was a part of X11, and since Ubuntu is now using Wayland that screwed things up, I think.

    Anyway to fix this?

    Oh, ok. I just had to install libfreetype6 and libfreetype6-dev with apt-get. I can't answer it now so I'll edit it later or something.

  • ruh roh
    ruh roh over 11 years
    I have now! Truth be told I realized now that they tell you in the matplotlib page that you need libpng and freetype but I guess I just skipped that part. Thanks anyway though.
  • Somu
    Somu almost 10 years
    OP has already clarified in an edit that the issue is solved: Oh, ok. I just had to install libfreetype6 and libfreetype6-dev with apt-get.
  • ako
    ako almost 4 years
    I had the same problem when compiling php-7.1.12 on CentOS-7, I did /usr/include/freetype2 and every thing went OK.