Matplotlib installation fails due to error with Freetype #74

Closed
dialkforkaushik opened this Issue Dec 21, 2013 · 10 comments

Comments

Projects
None yet
7 participants

Please find gist here: https://gist.github.com/anonymous/8075373.

I am new to Homebrew, and was trying to get my (scientific) python installation going. I was able to successfully install Python 2.7, NumPy, SciPy and IPython. However, my Matplotlib installation failed. I do have Brew installed Freetype though. (Both /usr/local/include/freetype2 and /usr/local/opt/freetype/include/freetype2 exist.)

It would really help me if you could provide me with a workaround !

(Bait: Hopefully, with some familiarity and once I get going, I'd be able to give back to !!)

Similarly, under Mountain Lion (10.8.5):

$ brew install matplotlib
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/matplotlib-1.3.1.tar.gz
==> /usr/bin/python setup.py 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
...
$ brew list
autoconf    ffmpeg      glib        irssi       libmpc      mtr     suite-sparse    yasm
automake    freetype    gmp     isl     libpng      nginx       tbb
bind        fuse4x      gnupg       jpeg        libtiff     numpy       texi2html
cloog       fuse4x-kext graphviz    lame        libtool     p7zip       x264
ext4fuse    gettext     id3lib      libffi      mad     pcre        xvid
faac        gfortran    imagemagick libid3tag   mpfr        pkg-config  xz
$ brew doctor
Your system is ready to brew.
Contributor

samueljohn commented Dec 27, 2013

Thanks for your report... I am trying to reproduce this issue

Contributor

samueljohn commented Dec 27, 2013

Damn, I get the same (or similar) error:

/usr/X11/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
         ^
1 error generated.
error: command 'clang' failed with exit status 1

terhardt commented Jan 6, 2014

Building with '--HEAD' will work, as this is already fixed upstream.

On 27 Dec 2013, at 16:14, Samuel John wrote:

Damn, I get the same (or similar) error:

/usr/X11/include/ft2build.h:56:10: fatal error: 
'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
      ^
1 error generated.
error: command 'clang' failed with exit status 1

Reply to this email directly or view it on GitHub:
samueljohn#74 (comment)

Contributor

samueljohn commented Jan 23, 2014

Thanks to @claudiodsf this should be fixed now.

samueljohn closed this Jan 23, 2014

@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
[http://trac.sagemath.org/ticket/16002#comment:18 here].
{{{
matplotlib-1.3.1
====================================================
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
powerpc
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/Users/student/Desktop/sage-6.2.beta5/local/libexec/
gcc/powerpc-apple-darwin8.11.0/4.7.3/lto-wrapper
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 setup.py
========================================================================
====
Edit setup.cfg to change the build options

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

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.7.0]
              dateutil: yes [using dateutil version 2.2]
               tornado: yes [tornado was not found. It is required for
the
                        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
not
                        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
not
                        be found. Using unknown version.]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]

OPTIONAL BACKEND EXTENSIONS
                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]

OPTIONAL LATEX DEPENDENCIES
                dvipng: no
           ghostscript: no
                 latex: no
               pdftops: no

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

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

See [https://gist.github.com/anonymous/8075373 another]
[Homebrew/homebrew-python#74 reports on]
[Homebrew/homebrew-python#62 homebrew] for
something very similar.  [http://trac.macports.org/ticket/41593 Here]
[Homebrew/homebrew-versions#302 are some]
[matplotlib/matplotlib#2623 fixes].  Somewhat
surprisingly, the [efiring/matplotlib@be37790
449641a6ead3af2d2334cc544789e869 mpl commit] is a one-liner.

URL: http://trac.sagemath.org/16047
Reported by: kcrisman
Ticket author(s): Karl-Dieter Crisman
Reviewer(s): Volker Braun
5d17ca9

vielmetti referenced this issue in metacollin/homebrew-gnuradio Mar 29, 2015

Open

Build fails on 10.9.5 Mavericks #27

the same on Yosemite with pip, under python3.4

Owner

dunn commented Jul 20, 2015

@DSLituiev could you post brew gist-logs matplotlib, please?

$ brew list
freetype    libpng

$ brew gist-logs matplotlib
Error: No available formula for matplotlib
Owner

tdsmith commented Jul 20, 2015

If you're using pip, it's not an issue with homebrew-python. We may be able to help anyway but please create a new issue with logs containing the error message.

right! sorry

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