Error installing matplotlib 0.98.5

Dear ALL,

I have experienced a strange problem when installing Matplotlib 0.98.5
using Easy_Install under Ubuntu Hardy. I receive a message like this:
"error: lib/matplotlib/mpl-data/matplotlib.conf.template: No such file
or directory " (etc.). I then tried sudo aptitude install
python-matplotlib, that gives no errors, but also do not install the
new version. In the end, I had to install from the source (and this,
of course, worked well).

Does anyone else have seen this problem (and, if so, has a solution to it)?

Thanks in advance.

With best regards,

···

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

Could you please post the entire shell session -- the command you run
and all the output?

Thanks,
JDH

···

On Sun, Dec 14, 2008 at 6:25 PM, Mauro Cavalcanti <maurobio@...287...> wrote:

Dear ALL,

I have experienced a strange problem when installing Matplotlib 0.98.5
using Easy_Install under Ubuntu Hardy. I receive a message like this:
"error: lib/matplotlib/mpl-data/matplotlib.conf.template: No such file
or directory " (etc.). I then tried sudo aptitude install
python-matplotlib, that gives no errors, but also do not install the
new version. In the end, I had to install from the source (and this,
of course, worked well).

Does anyone else have seen this problem (and, if so, has a solution to it)?

Hi,

John Hunter-4 wrote:

I have experienced a strange problem when installing Matplotlib 0.98.5
using Easy_Install under Ubuntu Hardy. I receive a message like this:
"error: lib/matplotlib/mpl-data/matplotlib.conf.template: No such file
or directory " (etc.). I then tried sudo aptitude install
python-matplotlib, that gives no errors, but also do not install the
new version. In the end, I had to install from the source (and this,
of course, worked well).

Does anyone else have seen this problem (and, if so, has a solution to
it)?

Could you please post the entire shell session -- the command you run
and all the output?

I experience the same problem. Full shell session (of one
command :wink: is following:

~$ sudo easy_install matplotlib
Searching for matplotlib
Reading Links for matplotlib
Reading http://matplotlib.sourceforge.net
Reading
matplotlib - Browse /matplotlib at SourceForge.net
Reading
matplotlib - Browse /matplotlib-maintenance at SourceForge.net
Reading matplotlib - Browse Files at SourceForge.net
Best match: matplotlib 0.98.5
Downloading
Download matplotlib-0.98.5.tar.gz (matplotlib)
Processing matplotlib-0.98.5.tar.gz
Running matplotlib-0.98.5/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-fpPLdN/matplotlib-0.98.5/egg-dist-tmp-0LZ25S

···

On Sun, Dec 14, 2008 at 6:25 PM, Mauro Cavalcanti <maurobio@...287...> > wrote:

============================================================================
BUILDING MATPLOTLIB
            matplotlib: 0.98.5
                python: 2.5.2 (r252:60911, Oct 5 2008, 19:29:17) [GCC
                        4.3.2]
              platform: linux2

REQUIRED DEPENDENCIES
                 numpy: 1.1.1
             freetype2: 9.18.3

OPTIONAL BACKEND DEPENDENCIES
                libpng: 1.2.27
               Tkinter: no
                        * Using default library and include directories for
                        * Tcl and Tk because a Tk window failed to open.
                        * You may need to define DISPLAY for Tk to work so
                        * that setup can determine where your libraries are
                        * located. Tkinter present, but header files are not
                        * found. You may need to install development
                        * packages.
              wxPython: 2.8.8.0
                        * WxAgg extension not required for wxPython >= 2.8
            pkg-config: looking for pygtk-2.0 gtk+-2.0
                        * Package pygtk-2.0 was not found in the pkg-config
                        * search path. Perhaps you should add the directory
                        * containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
                        * environment variable No package 'pygtk-2.0' found
                        * You may need to install 'dev' package(s) to
                        * provide header files.
                  Gtk+: no
                        * Could not find Gtk+ headers in any of
                        * '/usr/local/include', '/usr/include', '.'
       Mac OS X native: no
                    Qt: no
                   Qt4: no
                 Cairo: 1.4.12

OPTIONAL DATE/TIMEZONE DEPENDENCIES
              datetime: present, version unknown
              dateutil: 1.4
                  pytz: 2008b

OPTIONAL USETEX DEPENDENCIES
                dvipng: 1.11
           ghostscript: 8.63
                 latex: 3.141592
               pdftops: 3.00

EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
             configobj: matplotlib will provide
      enthought.traits: no

[Edit setup.cfg to suppress the above messages]

error: lib/matplotlib/mpl-data/matplotlib.conf.template: No such file or
directory
Exception exceptions.OSError: (2, 'No such file or directory',
'src/image.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x2fd7d40>> ignored
Exception exceptions.OSError: (2, 'No such file or directory',
'src/path.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x2fd7200>> ignored
Exception exceptions.OSError: (2, 'No such file or directory',
'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x2fd7b90>> ignored

--
Regards,
Alexander Chemeris.

SIPez LLC.
SIP VoIP, IM and Presence Consulting
http://www.SIPez.com
tel: +1 (617) 273-4000
--
View this message in context: http://www.nabble.com/Error-installing-matplotlib-0.98.5-tp21006554p21016170.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I can replicate it too, and I think I am getting some insight into
what is going on and it may point to a distutils and/or easy_install
bug (but one we can work around).

The file in question is matplotlib.conf.template, which exists in
lib/matplotlib/mpl-data. There is a symlink in doc/mpl_data which
points to lib/matplotlib/mpl-data. Eg in the mpl src tree::

    jdhunter@...2404...:mpl> ls -ld lib/matplotlib/mpl-data/ doc/mpl_data
    lrwxrwxrwx 1 jdhunter jdhunter 27 Jun 2 2008 doc/mpl_data ->
../lib/matplotlib/mpl-data/
    drwxrwxr-x 6 jdhunter jdhunter 4096 Dec 10 13:09 lib/matplotlib/mpl-data/

Now create the sdist::

    jdhunter@...2404...:mpl> python setup.py sdist > sdist.out
    jdhunter@...2404...:mpl> grep matplotlib.conf.template sdist.out
    hard linking doc/mpl_data/matplotlib.conf.template ->
matplotlib-0.98.5/doc/mpl_data
    hard linking lib/matplotlib/mpl-data/matplotlib.conf.template ->
matplotlib-0.98.5/lib/matplotlib/mpl-data

If we create an sdist, the symlink is backwards: the tarball says
lib/matplotlib/mpl-data/matplotlib.conf.template links to
doc/mpl_data/matplotlib.conf.template and has zero content

    jdhunter@...2404...:tmp> tar tvfz matplotlib-0.98.5.tar.gz |grep
matplotlib.conf.template
    -rw-r--r-- cmoad/staff 13838 2008-12-09 17:53
matplotlib-0.98.5/doc/mpl_data/matplotlib.conf.templatehrw-r--r--
cmoad/staff 0 2008-12-09 17:53
matplotlib-0.98.5/lib/matplotlib/mpl-data/matplotlib.conf.template
link to matplotlib-0.98.5/doc/mpl_data/matplotlib.conf.template

If you unpack the tarball using a standard incantation, a copy is made::

    jdhunter@...2404...:tmp> tar xfz matplotlib-0.98.5.tar.gz
    jdhunter@...2404...:tmp> cd matplotlib-0.98.5/
    jdhunter@...2404...:matplotlib-0.98.5> ls -ld
doc/mpl_data/matplotlib.conf.template
lib/matplotlib/mpl-data/matplotlib.conf.template
    -rw-r--r-- 2 jdhunter jdhunter 13838 Dec 9 17:53
doc/mpl_data/matplotlib.conf.template
    -rw-r--r-- 2 jdhunter jdhunter 13838 Dec 9 17:53
lib/matplotlib/mpl-data/matplotlib.conf.template

I think what may be happening is that setuptools are reading the
tarball using the python tarfile reader and the link is getting
botched. However, I can read the "missing" file using tarfile::

    In [17]: import tarfile

    In [18]: t = tarfile.open('dist/matplotlib-0.98.5.tar.gz')

    In [19]: o =
t.extractfile('matplotlib-0.98.5/lib/matplotlib/mpl-data/matplotlib.conf')

    In [20]: s = o.read()

    In [21]: print s[:80]
    # MPLConfig - plaintext (in .conf format)

    # This is a sample matplotlib configu

So I am not sure exactly what is going wrong but I think broken
handling of the link is playing a role. I will probably work around
this by removing the links and making hard copies myself before
building the sdist and eggs, unless I hear something more intelligent
from someone or come up with something better.

···

On Mon, Dec 15, 2008 at 9:45 AM, Alexander Chemeris <alexander.chemeris@...287...> wrote:

I experience the same problem. Full shell session (of one
command :wink: is following:

~$ sudo easy_install matplotlib
Searching for matplotlib
Reading Links for matplotlib
Reading http://matplotlib.sourceforge.net
Reading
matplotlib - Browse /matplotlib at SourceForge.net
Reading
matplotlib - Browse /matplotlib-maintenance at SourceForge.net
Reading matplotlib - Browse Files at SourceForge.net
Best match: matplotlib 0.98.5
Downloading
Download matplotlib-0.98.5.tar.gz (matplotlib)
Processing matplotlib-0.98.5.tar.gz
Running matplotlib-0.98.5/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-fpPLdN/matplotlib-0.98.5/egg-dist-tmp-0LZ25S
...snip
error: lib/matplotlib/mpl-data/matplotlib.conf.template: No such file or
directory
Exception exceptions.OSError: (2, 'No such file or directory',
'src/image.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x2fd7d40>> ignored
Exception exceptions.OSError: (2, 'No such file or directory',
'src/path.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x2fd7200>> ignored
Exception exceptions.OSError: (2, 'No such file or directory',
'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x2fd7b90>> ignored