Python not configured for Tk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ralph1
    New Member
    • Mar 2007
    • 3

    Python not configured for Tk

    I am running Mac osx 10.4 on a Pentium iMac. I have downloaded, unpacked and installed Tcl 8.5a5, Tk 8.5a5, and then Python 2.5.

    When I attempt to import Tkinter from a Python shell, I get the following:

    >>> import Tkinter
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/Library/Frameworks/Python.framewor k/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py", line 38, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
    ImportError: dlopen(/Library/Frameworks/Python.framewor k/Versions/2.5/lib/python2.5/lib-dynload/_tkinter.so, 2): Library not loaded: /Library/Frameworks/Tcl.framework/Versions/8.4/Tcl
    Referenced from: /Library/Frameworks/Python.framewor k/Versions/2.5/lib/python2.5/lib-dynload/_tkinter.so
    Reason: image not found
    >>>

    Soooo...... just how DO I "configure" Python for Tk? And what image was not found? How do we find it?

    Thanks,
    Ralph
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by ralph1
    I have downloaded, unpacked and installed Tcl 8.5a5, Tk 8.5a5, and then Python 2.5.
    There's your problem. All packages must be installed AFTER python is installed. (should be true on the Mac, too)

    Comment

    • Ralph1
      New Member
      • Mar 2007
      • 3

      #3
      Originally posted by bartonc
      There's your problem. All packages must be installed AFTER python is installed. (should be true on the Mac, too)
      I just reinstalled tcl and tk then rebooted (just in case), opened Python in a terminal window and typed in import Tkinter... same result.
      "Traceback. .. import _tkinter # If this fails your Python may not be configured for Tk... Reason: image not found"

      Surely there must be some way to configure Python to use tcl/tk. When installing Python perhaps?

      Comment

      Working...