Skip to content

Instantly share code, notes, and snippets.

@jamesluberda
Created July 19, 2015 22:53
Show Gist options
  • Save jamesluberda/de590312c0f9b5ce063b to your computer and use it in GitHub Desktop.
Save jamesluberda/de590312c0f9b5ce063b to your computer and use it in GitHub Desktop.
Installing matplotlib 1.4.3 on CentOS 5

Installing matplotlib 1.4.3 on CentOS 5

To install the Python library matplotlib on a stock CentOS 5 system, you will need to resolve a freetype dependency issue prior to install. matplotlib 1.4.3 requires freetype ver >=2.3. CentOS 5's repositories top out at freetype 2.2.1.

To meet this dependency, download, compile and install a more recent version of freetype from here (this has been verified to work on a CentOS 5 system with freetype 2.4.0)

After downloading, do the usual unpack, configure, and make. Note that the default configuration will place the new freetype under /usr/local; for reference, the base CentOS install is under /usr.

Substitute the appropriate version of freetype below if not using 2.4.0

$ tar -xvf freetype-2.4.0.tar.gz
$ cd freetype-2.4.0
$ ./configure
$ make
$ sudo make install

Run to confirm:

$ freetype-config --ftversion

If /usr/local/bin is in your path and appears before /usr/bin, you should see

$ freetype-config --ftversion
2.4.0

(or whatever more recent version you downloaded) Then proceed to install matplotlib according to your preference, i.e.

$ pip install matplotlib
@cmdcolin
Copy link

cmdcolin commented Aug 8, 2016

An alternative method to upgrading freetype is to install specific versions of numpy and matplotlib http://stackoverflow.com/questions/22076553/matplotlib-install-issues-pip-centos-freetype-missing-when-it-is-installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment