matplotlib installation failing on 10.9 #62

claudiodsf opened this Issue Nov 28, 2013 · 10 comments


None yet
4 participants

claudiodsf commented Nov 28, 2013

With the following error:

➜  ~  brew install matplotlib
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading
Already downloaded: /Library/Caches/Homebrew/matplotlib-1.3.1.tar.gz
==> /usr/local/opt/python/bin/python2 install --prefix=/usr/local/Cellar/matplotlib/1.3.1 -
/usr/X11/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1

If reporting this issue please do so at (not mxcl/homebrew):

I'm reporting this here, but my feeling is that this is an incompatibility between XQuartz and the recently upgraded freetype 2.5.1.
From the FreeType web page:

FreeType 2.5.1
FreeType 2.5.1 has been released, providing three major new features.

  • Support for the WOFF font format, contributed by Behdad Esfahbod.
  • The auto-hinter now supports Hebrew, together with improved support for Cyrillic and Greek.
  • The directory layout of the (installed) FreeType header files has been simplified.

Let me know what do you think and if you can reproduce this.


claudiodsf commented Nov 28, 2013

Reverting to freetype makes it compile correctly.

There seems to be a fix in the works upstream: matplotlib/matplotlib#2622

I downloaded freetype, put it under /usr/local/Cellar/Freetype accompanied with 2.5.1, then switch to the former version according to tobe advised. The pillow installation went well, but when I tried to compile matplotlib, an error occured:

$ brew install matplotlib ✘
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading
######################################################################## 100.0%
==> /usr/local/opt/python/bin/python2 install --prefix=/usr/local/Cellar/matplotlib/1.3.1 --record=installed.txt --single-version-externally-managed
pdftops: no

                    * The following required packages can not be built:
                    * freetype

claudiodsf commented Dec 4, 2013

@MagisDing This is what I did to revert to

$  brew versions freetype
Warning: brew-versions is unsupported and may be removed soon.
Please use the homebrew-versions tap instead:
2.5.1    git checkout 129ebdc /usr/local/Library/Formula/freetype.rb  git checkout 6314fdb /usr/local/Library/Formula/freetype.rb
2.4.11   git checkout 0e450f2 /usr/local/Library/Formula/freetype.rb
2.4.10   git checkout 09d7bd7 /usr/local/Library/Formula/freetype.rb
$  cd /usr/local
$  git checkout 6314fdb /usr/local/Library/Formula/freetype.rb
$  brew rm freetype && brew install freetype
$  brew pin freetype
$  git checkout 129ebdc /usr/local/Library/Formula/freetype.rb

@claudiodsf Thx mate! Finally, I got Matplotlib installed.

But I still wondering what is the function of command:

$ brew pin freetype
$ git checkout 129ebdc /usr/local/Library/Formula/freetype.rb



claudiodsf commented Dec 5, 2013

@MagisDing The first git checkout restores the freetype formula. Then you install it.

Then, with brew pin freetype you prevent to upgrade this formula when doing a brew upgrade.
Having done this, you can safely restore the freetype 2.5.1 formula, through the second git checkout, since it will not be automatically upgraded.

When this issue will be fixed, you can brew unpin freetype and upgrade it.


claudiodsf commented Dec 5, 2013

For the records, I tried again with freetype 2.5.1, after this commit: mxcl/homebrew#24921, but matplotlib installation still fails.


claudiodsf commented Dec 5, 2013

And I report here the reference @jacknagel provided in that issue:

@claudiodsf claudiodsf added a commit to claudiodsf/homebrew-python that referenced this issue Dec 5, 2013

@claudiodsf claudiodsf Fix for matplotlib and freetype 2.5.1
Fixes #62.

claudiodsf commented Dec 5, 2013

It looks like this has been fixed upstream. I made a pull request with an updated formula that includes the upstream patch. Let me know.

deemox commented Dec 11, 2013

Thanks @claudiodsf ... I ran into this issue as well, and pinning helped fix it until the pull request is closed.

mhemeryck referenced this issue in Homebrew/homebrew-versions Jan 8, 2014


freetype #302

@vbraun vbraun added a commit to vbraun/sage that referenced this issue Apr 5, 2014

@vbraun Release Manager + vbraun Trac #16047: Fix mpl header search issues on OS X 10.4
I have no idea whether this is really just an issue on this platform,
but it was discovered here.  Thanks to ppurka for tracking down the
likely culprit for this failure
[ here].
Setting up build directory for matplotlib-1.3.1
Finished set up
Host system:
Darwin Dasher-03.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10
18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh
C compiler: gcc
C compiler version:
Using built-in specs.
Target: powerpc-apple-darwin8.11.0
Configured with: ../src/configure
--prefix=/Users/student/Desktop/sage-6.2.beta5/local --with-local-
prefix=/Users/student/Desktop/sage-6.2.beta5/local --with-
gmp=/Users/student/Desktop/sage-6.2.beta5/local --with-
mpfr=/Users/student/Desktop/sage-6.2.beta5/local --with-
mpc=/Users/student/Desktop/sage-6.2.beta5/local --with-system-zlib
--disable-multilib --disable-nls
Thread model: posix
gcc version 4.7.3 (GCC)
NOTE: Set SAGE_MATPLOTLIB_GUI to anything but 'no' to try to build the
Matplotlib GUI.
Not building any matplotlib graphical backends.
patching file lib/matplotlib/tri/_tri.cpp
patching file lib/matplotlib/tri/_tri.h
patching file
Edit setup.cfg to change the build options

            matplotlib: yes [1.3.1]
                python: yes [2.7.5 (default, Mar 26 2014, 08:50:37)
              platform: yes [darwin]

                 numpy: yes [version 1.7.0]
              dateutil: yes [using dateutil version 2.2]
               tornado: yes [tornado was not found. It is required for
                        WebAgg backend. pip/easy_install may attempt to
                        install it after matplotlib.]
             pyparsing: yes [using pyparsing version 2.0.1]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could
                        be found. Using local copy.]
              freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                        could not be found.  You may need to install the
                        development package.]
                   png: yes [pkg-config information for 'libpng' could
                        be found. Using unknown version.]

           sample_data: yes [installing]
              toolkits: yes [installing]

                macosx: no  [skipping due to configuration]
                qt4agg: no  [PyQt4 not found]
               gtk3agg: no  [Requires pygobject to be installed.]
             gtk3cairo: no  [Requires cairo to be installed.]
                gtkagg: no  [skipping due to configuration]
                 tkagg: no  [skipping due to configuration]
                 wxagg: no  [skipping due to configuration]
                   gtk: no  [skipping due to configuration]
                   agg: yes [installing]
                 cairo: no  [cairo not found]
             windowing: no  [skipping due to configuration]

                dvipng: no
           ghostscript: no
                 latex: no
               pdftops: no

                        * The following required packages can not be
                        * freetype
Error building matplotlib package.

real    0m10.504s
user    0m4.290s
sys     0m2.525s
Error installing package matplotlib-1.3.1

See [ another]
[Homebrew/homebrew-python#74 reports on]
[Homebrew/homebrew-python#62 homebrew] for
something very similar.  [ Here]
[Homebrew/homebrew-versions#302 are some]
[matplotlib/matplotlib#2623 fixes].  Somewhat
surprisingly, the [efiring/matplotlib@be37790
449641a6ead3af2d2334cc544789e869 mpl commit] is a one-liner.

Reported by: kcrisman
Ticket author(s): Karl-Dieter Crisman
Reviewer(s): Volker Braun

hollandjg referenced this issue in matplotlib/matplotlib May 19, 2014


freetype cannot be found by build #3029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment