building matplotib on linux

All: I am trying to build matplotlib 0.98.3 on a Red Hat Enterprise 5 linux box. I have Tkinter support compiled into my /usr/local/bin/python installation (at least "import Tkinter" raises no exceptions). However, when I try to build matplotlib using "/usr/local/bin/python setup.py build", I get the output below. Any hints? Is this my fault, or a bug in setup.py?

Thanks,

Mike

···

============================================================================
BUILDING MATPLOTLIB
            matplotlib: 0.98.3
                python: 2.5.2 (r252:60911, Sep 15 2008, 16:18:30) [GCC
                        4.1.2 20071124 (Red Hat 4.1.2-42)]
              platform: linux2

REQUIRED DEPENDENCIES
                 numpy: 1.1.0
             freetype2: found, but unknown version (no pkg-config)
                        * WARNING: Could not find 'freetype2' headers in any
                        * of '/usr/local/include', '/usr/include', '.',
                        * '/usr/local/include/freetype2',
                        * '/usr/include/freetype2', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
                libpng: 1.2.10
Traceback (most recent call last):
  File "setup.py", line 125, in <module>
    if check_for_tk() or (options['build_tkagg'] is True):
  File "/home/mhearne/build/matplotlib-0.98.3/setupext.py", line 841, in check_for_tk
    explanation = add_tk_flags(module)
  File "/home/mhearne/build/matplotlib-0.98.3/setupext.py", line 1101, in add_tk_flags
    module.libraries.extend(['tk' + tk_ver, 'tcl' + tk_ver])
UnboundLocalError: local variable 'tk_ver' referenced before assignment

--
------------------------------------------------------
Michael Hearne
mhearne@...924...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------

I installed the freetype-devel libraries and this problem went away.

--Mike

Michael Hearne wrote:

···

All: I am trying to build matplotlib 0.98.3 on a Red Hat Enterprise 5 linux box. I have Tkinter support compiled into my /usr/local/bin/python installation (at least "import Tkinter" raises no exceptions). However, when I try to build matplotlib using "/usr/local/bin/python setup.py build", I get the output below. Any hints? Is this my fault, or a bug in setup.py?

Thanks,

Mike

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

BUILDING MATPLOTLIB
           matplotlib: 0.98.3
               python: 2.5.2 (r252:60911, Sep 15 2008, 16:18:30) [GCC
                       4.1.2 20071124 (Red Hat 4.1.2-42)]
             platform: linux2

REQUIRED DEPENDENCIES
                numpy: 1.1.0
            freetype2: found, but unknown version (no pkg-config)
                       * WARNING: Could not find 'freetype2' headers in any
                       * of '/usr/local/include', '/usr/include', '.',
                       * '/usr/local/include/freetype2',
                       * '/usr/include/freetype2', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
               libpng: 1.2.10
Traceback (most recent call last):
File "setup.py", line 125, in <module>
   if check_for_tk() or (options['build_tkagg'] is True):
File "/home/mhearne/build/matplotlib-0.98.3/setupext.py", line 841, in check_for_tk
   explanation = add_tk_flags(module)
File "/home/mhearne/build/matplotlib-0.98.3/setupext.py", line 1101, in add_tk_flags
   module.libraries.extend(['tk' + tk_ver, 'tcl' + tk_ver])
UnboundLocalError: local variable 'tk_ver' referenced before assignment

--
------------------------------------------------------
Michael Hearne
mhearne@...924...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------

Any chance you also installed tk-devel or tcl-devel? I can't see how
the addition of the freetype headers would fix a tk problem.

JDH

···

On Tue, Sep 23, 2008 at 10:28 AM, Michael Hearne <mhearne@...924...> wrote:

I installed the freetype-devel libraries and this problem went away.

No. Interestingly, I didn't get the same errors this morning as I did last night - I got build errors regarding ftbuild (or something like that). I had just installed Tcl/Tk from source, so perhaps the first time my shell hadn't figured out where they were (??). After I installed freetype-devel, the build errors went away. The Tk errors vanished on their own.

I don't know why I have so much trouble building and installing software...

Thanks,

Mike Hearne

John Hunter wrote:

···

On Tue, Sep 23, 2008 at 10:28 AM, Michael Hearne <mhearne@...924...> wrote:
  

I installed the freetype-devel libraries and this problem went away.

Any chance you also installed tk-devel or tcl-devel? I can't see how
the addition of the freetype headers would fix a tk problem.

JDH
  
--
------------------------------------------------------
Michael Hearne
mhearne@...924...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------