Tcl/Tk Tkinter version 8.4 and 8.5 conflict on Mac Os X 10.4.11 with python 2.6.4

岁酱吖の 提交于 2020-01-05 10:27:32

问题


I am having trouble getting Tkinter up and runnning in order to install matplot lib.

I am running Mac OS X 10.4.11, and just installed Python 2.6.4 .

After several other fights, one remaining battle for me to get matlotlib installed is to have a working version of Tkinter, although there are several in my Mac from Xcode and also Python, I guess they just aren't installed in useful places? After I installed Python 2.6.4, import _tkinter failed. So I installed Tcl 8.5 from active state.

Now, I make it to the Tkinter test:

Tkinter._test() Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 3746, in _test root = Tk() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1645, in init self._loadtk() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1659, in _loadtk % (_tkinter.TK_VERSION, tk_version) RuntimeError: tk.h version (8.4) doesn't match libtk.a version (8.5)

I realize you have discussed the exact error I am describing here: http://bugs.python.org/issue4017

but those errors arose from a problem with an earlier version of python, where setup.py reversed the order of where to look. The advice in your previous post is to fix this order in setup.py and rebuild python, but my setup.py is already looking good - it includes these lines:

def detect_tkinter_darwin(self, inc_dirs, lib_dirs): # The _tkinter module, using frameworks. Since frameworks are quite # different the UNIX search logic is not sharable. from os.path import join, exists framework_dirs = [ '/Library/Frameworks', '/System/Library/Frameworks/', join(os.getenv('HOME'), '/Library/Frameworks')

I would really appreciate any insight on how to handle this!( I am a biologist...)

While I'm at it, I'll include what is going on when I try to install m matplotlib in case it is useful...matplotlib thinks I have Tkinter 8.4 (ironically, only afeter I installed 8.5, before that it always said it could not find Tkinter):

Tkinter: Tkinter: 65971, Tk: 8.4, Tcl: 8.4

also, here is the error I run into when trying to build matplotlib:

powerpc-apple-darwin8-g++-4.0.1: unrecognized option '-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' i686-apple-darwin8-g++-4.0.1: unrecognized option '-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' /usr/bin/ld: -syslibroot: multiply specified collect2: ld returned 1 exit status /usr/bin/ld: -syslibroot: multiply specified collect2: ld returned 1 exit status lipo: can't open input file: /var/tmp//ccrblCgU.out (No such file or directory) error: command 'g++' failed with exit status 1 make: *** [mpl_build] Error 1

thank you!!

Katrine


回答1:


I think the important point from previous solutions proposed was that Python, upon install, detects the correct version and location of Tk. I assume you installed Tk after installing Python. This problem was solved on my machine when I reinstalled Python2.6 using the .dmg installer. I didn't need to rebuild or anything. I hope this helps. :)



来源:https://stackoverflow.com/questions/2247971/tcl-tk-tkinter-version-8-4-and-8-5-conflict-on-mac-os-x-10-4-11-with-python-2-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!