Skip to content

freetype cannot be found by build #3029

Closed
@kravietz

Description

@kravietz

I've tried to install matplotlib using pip on Linux and it couldn't find freetype during the build process, even though it's installed with dev packages.

freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                    could not be found.  You may need to install the
                    development package.]

But:

$ ls -l /usr/include/freetype2/ft2build.h 
-rw-r--r-- 1 root root 2383 Mar 13 17:29 /usr/include/freetype2/ft2build.h

And:

$ freetype-config --cflags
-I/usr/include/freetype2

Activity

tacaswell

tacaswell commented on May 1, 2014

@tacaswell
Member

Can you provide any more details (distribution, version etc)?

kravietz

kravietz commented on May 1, 2014

@kravietz
Author

Linux: Ubuntu 14.04 LTS

Libraries:

libfreetype6:amd64 2.5.2-1ubuntu2
libfreetype6-dev 2.5.2-1ubuntu2

Matplotlib matplotlib==1.3.1 (from pip)

I've checked the setupext.py and it looks that for freetype it only checks for the ft2build.h in /usr/include and not in /usr/include/freetype2 even though it's added to list of checked directories for FreeType.

tacaswell

tacaswell commented on May 1, 2014

@tacaswell
Member

I can not reproduce this in a virtual environment on 14.04.

kmike

kmike commented on May 2, 2014

@kmike
Contributor

It looks similar to #2623. Even if it is not the same issue, are there plans for 1.3.2? :)

espdev

espdev commented on May 7, 2014

@espdev

I have the same problem. I try to install matplotlib in a virtual environment on ubuntu server 14.04. freetype-devel has been installed (package libfreetype6-dev):

esp@ubuntu-srv:~/temp$ locate freetype | grep ft2build.h
/usr/include/freetype2/ft2build.h

But matplotlib does not find it.

tacaswell

tacaswell commented on May 7, 2014

@tacaswell
Member

@espdev What version of mpl?

espdev

espdev commented on May 7, 2014

@espdev

@tacaswell Version 1.3.1 from PyPI.

razius

razius commented on May 16, 2014

@razius
Contributor

A temporary fix would be to create a symlink before installing matplotlib using pip.

$ ln -s /usr/include/freetype2/ft2build.h /usr/include/
added this to the v1.4.0 milestone on May 16, 2014
steko

steko commented on May 24, 2014

@steko

I found the same issue on Debian unstable with Matplotlib 1.3.1 (both from PyPI and the tag release on github - although I think they're the same).

The fix by @razius at https://github.com/razius/matplotlib/commit/66ee42d194bef1d045918c54cc81a9cb186bd440 works for me and I managed to install matplotlib from source after applying the same patch to setupext.py

benesch

benesch commented on May 28, 2014

@benesch

@kmike agreed, this looks like it's fixed by #2623.

@steko @kravietz @espdev does installing from the 1.3.x branch work?

pip install https://codeload.github.com/matplotlib/matplotlib/tar.gz/v1.3.x

If so, @tacaswell I renew my request for a 1.3.2.

benesch

benesch commented on May 28, 2014

@benesch

Never mind; upon further investigation, this is unrelated to #2623.

This bug only occurs if pkg-config is not installed; a simple

sudo apt-get install pkg-config

will shore up the include paths for now.

tacaswell

tacaswell commented on May 29, 2014

@tacaswell
Member

Closing this as #3067 is merged into master.

@benesch The issue with 1.3.2 is devs having enough time to produce one. As you can see we are swamped trying to get 1.4.0 out.

60 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steko@ameyp@kmike@julianofischer@post2web

        Issue actions

          freetype cannot be found by build · Issue #3029 · matplotlib/matplotlib