Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to install matplotlib via pip. There is a problem with freetype2.h

REQUIRED DEPENDENCIES

             numpy: 1.6.2

         freetype2: found, but unknown version (no pkg-config)

                    * WARNING: Could not find 'freetype2' headers in any

                    * of '.', './freetype2'.

Somebody had a similar problem ( How to install matplotlib on OS X?), and it was suggested to install pkg-config first. I did that with macports, but I still get the same warning.

I used find to look for the headers, and they are definitely present in:

/opt/X11/include/ft2build.h
/usr/X11/include/ft2build.h

How can I use those files to install matplotlib?

share|improve this question

2 Answers 2

Matplotlib require freetype. And you lost freetype c lib.
on Linux/Ubuntu, install freetype2 lib first

sudo apt-get install libfreetype6
share|improve this answer
    
Downvote because this is not sufficient. Pip installing matplotlib also requires at least libfreetype6-dev. –  Jonathan Hartley Jul 24 at 21:01

I think you ought to be able to install the freetype headers (and also the Python ones, which will be needed too) in the expected place using:

sudo apt-get install libfreetype6-dev python-dev

But, for reasons I don't understand, after this, I still got a 'missing python.h' error when pip installing matplotlib. It didn't work for me until I had done:

sudo apt-get build-dep python-matplotlib

which installed & compiled craploads of junk (presumably for optional features of matplotlib?)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.