9

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

4 Answers 4

9

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!

1
  • Worked for me on CentOS 5
    – Colin D
    Aug 8, 2016 at 23:20
2

I have just had a similar (albeit not exactly the same) situation. I'll write it up here as this page comes up among the first search results.

  • CentOS 5
  • pip install matplotlib complains about freetype
  • Both freetype and freetype-devel are installed.
  • ~/.pip/pip.log provides the explanation of the problem. There is the line:

    freetype: no [Requires freetype2 2.3 or later. Found 2.2.1.]

  • Obviously, the solution is either to upgrade freetype or downgrade matplotlib.
  • The second is easier (assuming I am OK with the older version).
  • pip install matplotlib==1.3.1 works fine.
1

On the matplotlib installation, this is what I did. Not sure if this is going to help you. Just followed the steps here: http://pkgs.org/centos-6/centos-x86_64/python-matplotlib-0.99.1.2-1.el6.x86_64.rpm.html

I did not use pip, btw and have CentOS 6.4.

0

I had this happen to me in two different situations, see if yours is one of them:

  1. freetype was installed, but not in the $PATH yet. Just exiting the shell and starting a new one fixed this.

  2. I was building matplotlib from source, and trying to build from the master branch. After I switched to v1.3.x it correctly detected freetype.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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