Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#13929 closed defect (fixed)

py25-tkinter links wrong tcl, tk libraries

Reported by: wiml@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: mww@…, skymoo (Adam Mercer)


Installing py25-tkinter compiles against the MacPorts headers for tcl/tk 8.5, but links the final .so against the system copies:

wiml@slowpoke-9A581% otool -L /opt/local/lib/python2.5/site-packages/
	/System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl (compatibility version 8.4.0, current version 8.4.0)
	/System/Library/Frameworks/Tk.framework/Versions/8.4/Tk (compatibility version 8.4.0, current version 8.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)

As a result, the Tkinter module fails with a version mismatch when you use it:

>>> t = Tkinter.Tk()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/lib/python2.5/lib-tk/", line 1638, in __init__
  File "/opt/local/lib/python2.5/lib-tk/", line 1658, in _loadtk
    % (_tkinter.TK_VERSION, tk_version)
RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.4)

Using DYLD_PRINT_LIBRARIES verifies that it's getting Python modules from /opt/local, but is loading Tcl/Tk from the system frameworks (and not loading ports' versions).

This is on Leopard, 10.5.1/9B18, with a fresh MacPorts install (just installed it and fired off 'install py25-matplotlib' today); this partition hasn't had MacPorts on it before. Version is "MacPorts 1.600", selfupdate says it's all up-to-date.

Change History (4)

comment:1 Changed 13 years ago by gui-dos (Guido Soranzio)

Cc: mww@… added
Milestone: Port Bugs

Changing in the Portfile

reinplace "s|__TK-VERSION__|8.4|g"


reinplace "s|__TK-VERSION__|8.5|g"

solves it.

comment:2 Changed 13 years ago by skymoo (Adam Mercer)

Cc: ram@… added

patch applied to py-tkinter in r33349

comment:3 Changed 13 years ago by gui-dos (Guido Soranzio)

Resolution: fixed
Status: newclosed

Fixed in r33426

comment:4 Changed 12 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.