How can I get Tkinter to work in Python? (I tried many things)

Discussion in 'Python' started by tomzam@gmail.com, Apr 28, 2009.

  1. Guest

    I am trying to get Tkinter to work with my Python build.
    I've scoured usenet(comp.lang.Python) and google and there's
    information that's helpful but I just can't seam to get it completely
    right. I tried many of the suggestion, but nothing seems to work
    My setup is Fedora Core 6 [my yum is also broken. (sigh. yes, I know
    I should upgrade)]
    I've download Tcl/Tk from Active State and installed it here:
    /usr/ActiveTcl-8.5
    My python to build is in this directory:
    /home/tomzam/mylib6/Python-2.6.2
    I removed the comment symbol (#) from the line:
    _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
    in the Modules/Setup
    so the lines in the Setup file look like this:

    # *** Always uncomment this (leave the leading underscore in!):
    _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
    # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
    -L/usr/ActiveTcl-8.5/lib/tk8.5 \
    # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
    -I/usr/ActiveTcl-8.5/include/tcl8.5 \
    when I run ./configure in /home/tomzam/mylib6/Python-2.6.2 everything
    looks
    right but then I try running make in /home/tomzam/mylib6/Python-2.6.2

    There are errors, but since there is many of them:
    here is a cut out of the _tkinter errors:

    libpython2.6.a(_tkinter.o): In function `Tkapp_CallProc':
    /home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1263: undefined
    reference to `Tcl_MutexLock'
    /home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1264: undefined
    reference to `Tcl_ConditionNotify'
    /home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1265: undefined
    reference to `Tcl_MutexUnlock'
    /home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1251: undefined
    reference to `Tcl_GetStringResult'
    libpython2.6.a(_tkinter.o): In function `Tkapp_CallDeallocArgs':
    /home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1123: undefined
    reference to `Tcl_Free'
    libpython2.6.a(tkappinit.o): In function `Tcl_AppInit':
    /home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:48: undefined
    reference to `Tcl_Init'
    /home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:77: undefined
    reference to `Tcl_GetVar'
    /home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:81: undefined
    reference to `Tk_Init'
    /home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:84: undefined
    reference to `Tk_MainWindow'
    /home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:81: undefined
    reference to `Tk_Init'
    collect2: ld returned 1 exit status
    make: *** [python] Error 1

    But since they are all undefined references - I feel I'm pretty close
    to a solution.

    Can you help me the rest of the way?
    I'm trying to make tkinter work with my local Python install,
    any help will be appreciated!

    Thank in advance,
    -Tom Z
    , Apr 28, 2009
    #1
    1. Advertising

  2. On Mon, 27 Apr 2009 17:49:26 -0700 (PDT), wrote:
    [snip]
    > There are errors, but since there is many of them:
    > here is a cut out of the _tkinter errors:
    >
    > libpython2.6.a(_tkinter.o): In function `Tkapp_CallProc':
    > /home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1263: undefined
    > reference to `Tcl_MutexLock'


    I believe this message means that something named _tkinter.c
    was previously compiled into an object file named
    _tkinter.o, which was bundled into a library named
    libpython2.6.a; and that when you attempt to use
    libpython2.6.a to satisfy the external references of something
    (not identified) that you're trying to link, the linker
    discovers that _tkinter.o contains a function Tkapp_CallProc
    that (on line 1263 of _tkinter.c) attempts to call function
    Tcl_MutexLock, but the linker can't find anything named
    Tcl_MutexLock to satisfy it.

    Tcl_MutexLock is probably *supposed* to be provided by some
    Tcl runtime library, but not being very knowledgeable, I
    don't know what library. Just before the beginning of the
    list of error messages, you'll probably find the command line
    that's running the linker, and it probably names a bunch of
    libraries, one of which is supposed to include Tcl_Mutexlock
    but doesn't. I apologize for being so vague; with any luck,
    someone much smarter will come along soon.

    --
    To email me, substitute nowhere->spamcop, invalid->net.
    Peter Pearson, Apr 28, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joseph Millar
    Replies:
    4
    Views:
    705
    Andy Fish
    Aug 15, 2003
  2. stan k.
    Replies:
    1
    Views:
    9,743
    Babu Kalakrishnan
    Nov 7, 2003
  3. Heather Stovold

    So many things that need to be decided....

    Heather Stovold, May 3, 2005, in forum: Python
    Replies:
    14
    Views:
    533
    Mike Meyer
    May 6, 2005
  4. =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=

    vs2005 publish website doing bad things, bad things

    =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=, Oct 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    597
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Oct 25, 2006
  5. Zed A. Shaw
    Replies:
    0
    Views:
    266
    Zed A. Shaw
    Apr 1, 2008
Loading...

Share This Page