Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 214
John Z Avatar asked Feb 27 '14 17:02

John Z


3 Answers

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!

like image 57
Byron Dover Avatar answered Nov 09 '22 08:11

Byron Dover


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.
like image 25
KT. Avatar answered Nov 09 '22 08:11

KT.


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.

like image 34
Jey Avatar answered Nov 09 '22 09:11

Jey