Reputation: 474
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
Upvotes: 9
Views: 5792
Reputation: 161
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!
Upvotes: 9
Reputation: 11430
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.
pip install matplotlib
complains about freetype
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.]
freetype
or downgrade matplotlib
.pip install matplotlib==1.3.1
works fine.Upvotes: 2
Reputation: 936
I had this happen to me in two different situations, see if yours is one of them:
freetype was installed, but not in the $PATH
yet. Just exiting the shell and starting a new one fixed this.
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.
Upvotes: 0
Reputation: 600
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.
Upvotes: 1