Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


             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:


How can I use those files to install matplotlib?

share|improve this question

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 '14 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


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.