3

I want to install matplotlib 1.5.1 for python 3.4 on Ubuntu 14.04.

But, when I type in the terminal sudo apt-get install python3-matplotlib, I just get matplotlib 1.3.1.

I have tried to use pip to install matplotlib, but I got some errors that weren't easy to solve.

Is there an easy way to install matplotlib 1.5.1 on Ubuntu?

  • Rather than guessing what you think the package name should be, apt-cache search python3 | grep -i matplot – waltinator Jan 17 '16 at 19:08
2

You could be just 4 terminal commands away from an easy installation, depending on the state of your system.

First, there is always risk breaking from the herd. My 15.10 system only has python-matplotlib 1.4.1something or other.

You could download the source

Once you have satisfied the requirements detailed in the INSTALL file (mainly python, numpy, libpng and freetype), you can build matplotlib.

  1. sudo apt-get build-dep python-matplotlib to install all dependecies required to build matplotlib

  2. cd ~/Downloads/matplotlib because that is where you unpacked the archive

  3. python3 setup.py build

  4. sudo python3 setup.py install

The instructions use default interpreter, I used python3 and mine built/installed without a hitch, your success will depend on the state of your system. Read the error logs. They will tell you what went wrong. Generally involving sudo apt-get install <lib[some]-dev>, or pre-emptively,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.