3

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?

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
  • 1
    Welcome to Stack Overflow! Please edit your question to include the exact quote of your full error code you're getting as it often contains more useful information besides the name of the error. – SuperBiasedMan Aug 14 '15 at 16:43
  • `distribute` is dead. Use `setuptools` and `pip` to install your packages. – cel Aug 14 '15 at 16:55
  • it still doesnt work . pls try it out and if you do find a solution then pls let me know . – Rowan Menezes Aug 14 '15 at 18:15

1 Answers1

3

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.

Community
  • 1
  • 1
J Richard Snape
  • 20,116
  • 5
  • 51
  • 79