Matplotlib – Installation

Using the Git repository (2011-06-14)

https://github.com/matplotlib/matplotlib

git clone https://github.com/matplotlib/matplotlib

python setup.py build

sudo python setup.py install

HowTo check the installed version (2011-06-26)

(i)python

import matplotlib

matplotlib.__version__

Installing newest version under Ubuntu 10.10

One can obtain it from http://matplotlib.sourceforge.net/. According to the INSTALL file I install the following packages:

sudo apt-get install libfreetype6

sudo apt-get install libfreetype6-dev

sudo apt-get install libpng12-0

sudo apt-get install libpng12-dev

sudo apt-get install zlib1g

sudo apt-get install zlib1g-dev

(They where all already installed..) And then also

sudo apt-get install python-gtk2

sudo apt-get install python-gtk2-dev

sudo apt-get install python-qt4

sudo apt-get install python-qt4-dev

sudo apt-get install tcl

sudo apt-get install tcl-dev

sudo apt-get install tk

sudo apt-get install tk-dev

sudo apt-get install python-tk

sudo apt-get install libglib2.0-0

sudo apt-get install libglib2.0-dev

Here at least some of the dev-packages where not present. One can search for the right package name via

sudo apt-cache search xxx

Note that on Ubuntu the devel packages are usually abbriviated by dev.

After I installed all this packages I tried

python setup.py build

I obtained the following errors:

/usr/bin/ld: cannot find -ltk8.5
/usr/bin/ld: cannot find -ltcl8.5

Then I upgraded the packages

sudo apt-get upgrade

And updated the library cache http://linux.die.net/man/8/ldconfig

sudo ldconfig

After installing and removing a few packages I finally found out that one has to install

sudo apt-get install tcl8.5-dev

sudo apt-get install tk8.5-dev

explicitly in order to obtain the right dev-support…

Using the subversion repository

http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-git

http://sourceforge.net/scm/?type=svn&group_id=80706

svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib matplotlib

Since this is far too long I just loaded

svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib/lib/matplotlib/

Then I discovered problems with

matplotlib/transforms.py in <module>()
32 import numpy as np
33 from numpy import ma
—> 34 from matplotlib._path import affine_transform
35 from numpy.linalg import inv
36

ImportError: No module named _path

So maybe I need more than just that and I tried

svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib/

python setup.py build

Due to the fact that I already build the release condidate by myself (see above), everything should work fine… And it Did!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: