Matplotlib install issues. Pip Centos - Freetype "Missing" when it is installed

centos, django, freetype, matplotlib, virtualenv

Solution

pip is going to compile matlibplot on your local machine, so you'll need freetype development headers installed as well.

CentOS 6+, Fedora, etc.:

$ sudo yum -y install freetype freetype-devel libpng-devel

On older operating systems (e.g. CentOS 5), you may run into a more specific freetype versioning issue with newer releases of matlibplot. If you're version agnostic, sticking with a legacy 1.3.x release will negate these dependency issues:

$ pip install matplotlib==1.3.1

Please note, you may need to downgrade your numpy to 1.8 in order to make matplotlib 1.3 work.

$ pip install numpy==1.8

Good luck!

Problem

I am using a virtualenv for a django setup. I am trying to build a view that pulls data from logs and then graphs the data. Eventually I would like to have this real-time and live. If you have any recommendations on other solutions that would suit my project best, please do not hesitate to include them in the comment fields below. I have attempted to install matplotlib from pip using pip install matplotlib. I receive the following message: ``` * The following required packages can not be built: * freetype ``` I then validated that it was installed ``` yum install freetype Package freetype-2.3.11-14.el6_3.1.x86_64 already installed and latest version ``` I then found that there is a python-matplotlib which is an older version .99. However, I want to keep this inside of the virtual environment and not system wide. ``` find / -name *freetype* /var/lib/yum/yumdb/f/d2807dcfe3762c0b9f8ef1d9bf0f05788e73282a-freetype-2.3.11-14.el6_3.1- x86_64 /usr/lib64/libfreetype.so.6.3.22 /usr/lib64/libfreetype.so.6 /usr/share/doc/freetype-2.3.11 ``` I searched all over stackoverflow and only saw solutions for ubuntu which did not transfer over to centos. Thank you for your time, John

Original source