cannot find tcl/tk headers. giving up.

Hi all,

I tried to build matplotlib on SuSE Linux 10.0
python setup.py build results in

.cannot find tcl/tk headers. giving up.

Any idea ?

I have installed

rpm -qi tk-devel
Name : tk-devel Relocations: (not relocatable)
Version : 8.4.11 Vendor: SUSE LINUX
Products GmbH, Nuernberg, Germany
Release : 5 Build Date: Tue 13 Sep 2005
01:10:13 AM CEST
Install date: Tue 28 Feb 2006 09:43:35 AM CET Build Host: barry.suse.de
Group : Development/Languages/Tcl Source RPM: tk-8.4.11-5.src.rpm
Size : 637061 License: BSD
Signature : DSA/SHA1, Tue 13 Sep 2005 01:14:50 AM CEST, Key ID
a84edae89c800aca
Packager : http://www.suse.de/feedback
URL : http://www.tcl.tk
Summary : Header Files and C API Documentation for Tk
Description :
This package contains header files and documentation needed for writing
Tk extensions in compiled languages like C, C++, etc., or for embedding
Tk in programs written in such languages.

This package is not needed for writing extensions or applications for
Tk in the Tcl language itself.

Authors:

···

--------
    John Ousterhout <john.ousterhout@...1018...>
Distribution: SUSE LINUX 10.0 (X86-64)

whitney:/usr/local/svn/matplotlib # rpm -qi tcl-devel
Name : tcl-devel Relocations: (not relocatable)
Version : 8.4.11 Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release : 2 Build Date: Fri 09 Sep 2005 07:26:00 PM CEST
Install date: Tue 28 Feb 2006 09:43:09 AM CET Build Host: Hygiea.suse.de
Group : Development/Languages/Tcl Source RPM: tcl-8.4.11-2.src.rpm
Size : 848628 License: BSD
Signature : DSA/SHA1, Fri 09 Sep 2005 08:35:27 PM CEST, Key ID a84edae89c800aca
Packager : http://www.suse.de/feedback
URL : http://www.tcl.tk
Summary : Header Files and C API Documentation for Tcl
Description :
This package contains header files and documentation needed for writing
Tcl extensions in compiled languages like C, C++, etc., or for
embedding the Tcl interpreter in programs written in such languages.

This package is not needed for writing extensions or applications in
the Tcl language itself.
Distribution: SUSE LINUX 10.0 (X86-64)

You had to change the function find_tcltk in setupext.py. There are a problem on suse with "tk.getvar('tcl_library')" who are pointing toward something like "/usr/share/lib/tcl" instead that where are really the library.

This is an example who work here:

def find_tcltk():
    """Finds Tcl/Tk includes/libraries/version by interrogating Tkinter."""
    try:
        import Tkinter
    except:
        print "Tkinter not properly installed\n"
        sys.exit(1)
    if Tkinter.TkVersion < 8.3:
        print "Tcl/Tk v8.3 or later required\n"
        sys.exit(1)
    o = FoundTclTk()
    try:
        tk=Tkinter.Tk() except Tkinter.TclError:
        print "Using default library and include directories for Tcl and Tk because a"
        print "Tk window failed to open. You may need to define DISPLAY for Tk to work"
        print "so that setup can determine where your libraries are located."
        o.tcl_lib = "/usr/lib"
        o.tcl_inc = "/usr/include"
        o.tk_lib = "/usr/lib"
        o.tk_inc = "/usr/include"
        o.tkv = ""
    else:
        tk.withdraw()
#not working on suse 10
        #o.tcl_lib = os.path.join((tk.getvar('tcl_library')), '../')
        #o.tk_lib = os.path.join(str(tk.getvar('tk_library')), '../')
        #o.tkv = str(Tkinter.TkVersion)[:3]
        #o.tcl_inc = os.path.join((tk.getvar('tcl_library')),
        # '../../include/tcl'+o.tkv)

#change introduce to tell where are the library and the version
        o.tcl_lib = "/usr/lib"
        o.tcl_inc = "/usr/include"
        o.tk_lib = "/usr/lib"
        o.tk_inc = "/usr/include"
        o.tkv = "8.4"

        if not os.path.exists(o.tcl_inc):
            o.tcl_inc = os.path.join((tk.getvar('tcl_library')),
                        '../../include')
        o.tk_inc = os.path.join((tk.getvar('tk_library')),
                    '../../include/tk'+o.tkv) if not os.path.exists(o.tk_inc):
            o.tk_inc = os.path.join((tk.getvar('tk_library')),
                        '../../include')
        if not os.path.exists(o.tcl_inc):
            print 'cannot find tcl/tk headers. giving up.'
            sys.exit()
    return o

Nils Wagner wrote:

···

Hi all,

I tried to build matplotlib on SuSE Linux 10.0
python setup.py build results in

.cannot find tcl/tk headers. giving up.

Any idea ?

I have installed

rpm -qi tk-devel
Name : tk-devel Relocations: (not relocatable)
Version : 8.4.11 Vendor: SUSE LINUX
Products GmbH, Nuernberg, Germany
Release : 5 Build Date: Tue 13 Sep 2005
01:10:13 AM CEST
Install date: Tue 28 Feb 2006 09:43:35 AM CET Build Host: barry.suse.de
Group : Development/Languages/Tcl Source RPM: tk-8.4.11-5.src.rpm
Size : 637061 License: BSD
Signature : DSA/SHA1, Tue 13 Sep 2005 01:14:50 AM CEST, Key ID
a84edae89c800aca
Packager : http://www.suse.de/feedback
URL : http://www.tcl.tk
Summary : Header Files and C API Documentation for Tk
Description :
This package contains header files and documentation needed for writing
Tk extensions in compiled languages like C, C++, etc., or for embedding
Tk in programs written in such languages.

This package is not needed for writing extensions or applications for
Tk in the Tcl language itself.

Authors:
--------
    John Ousterhout <john.ousterhout@...1018...>
Distribution: SUSE LINUX 10.0 (X86-64)

whitney:/usr/local/svn/matplotlib # rpm -qi tcl-devel
Name : tcl-devel Relocations: (not relocatable)
Version : 8.4.11 Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release : 2 Build Date: Fri 09 Sep 2005 07:26:00 PM CEST
Install date: Tue 28 Feb 2006 09:43:09 AM CET Build Host: Hygiea.suse.de
Group : Development/Languages/Tcl Source RPM: tcl-8.4.11-2.src.rpm
Size : 848628 License: BSD
Signature : DSA/SHA1, Fri 09 Sep 2005 08:35:27 PM CEST, Key ID a84edae89c800aca
Packager : http://www.suse.de/feedback
URL : http://www.tcl.tk
Summary : Header Files and C API Documentation for Tcl
Description :
This package contains header files and documentation needed for writing
Tcl extensions in compiled languages like C, C++, etc., or for
embedding the Tcl interpreter in programs written in such languages.

This package is not needed for writing extensions or applications in
the Tcl language itself.
Distribution: SUSE LINUX 10.0 (X86-64)

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users