Rowan Menezes
Rowan Menezes

Reputation: 31

not able to upgrade matplotlib to 1.4.3 on ubuntu 14.04

I've tried upgrading matplotlib using the following commands:

$export PYTHONHOME=/usr/lib/python2.7/

$sudo easy_install -U distribute

$sudo pip install --upgrade matplotlib

But none of them have worked. It shows an error after the matplotlib 1.4.3 package is downloaded but not installed.

Can anyone help upgrading this correctly?

Upvotes: 3

Views: 1234

Answers (1)

J Richard Snape
J Richard Snape

Reputation: 20344

The error you get says this.

============================================================================

                    * The following required packages can not be built:

                    * freetype, png

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/snapey/.pip/pip.log

If you look further up, it says

REQUIRED DEPENDENCIES AND EXTENSIONS:

... <Some other packages, all present>

              freetype: no  [The C/C++ header for freetype2 (ft2build.h)

                    could not be found.  You may need to install the

                    development package.]

               png: no  [pkg-config information for 'libpng' could not

                    be found.]

So, it's telling you the problem - freetype and png are not present and cannot be built

To rectify this - install them like so:

sudo apt-get install libfreetype6-dev libpng12-dev

This is almost a duplicate question, but looks like the problem is Python 3 specific (it isn't).

I found I then had to run pip install --upgrade matplotlib twice, as it failed with an error about python.h first time, but then I had matplotlib 1.4.3. Tested on Ubuntu 14.04 64 bit, python 2.7

As an aside - this is really ugly and should probably be raised with Ubuntu and / or matplotlib devs.

Upvotes: 3

Related Questions