Tcl/Tk Tkinter版本8.4和8.5在Mac Os X 10.4.11和python 2.6.4上发生冲突 [英] Tcl/Tk Tkinter version 8.4 and 8.5 conflict on Mac Os X 10.4.11 with python 2.6.4

查看:268
本文介绍了Tcl/Tk Tkinter版本8.4和8.5在Mac Os X 10.4.11和python 2.6.4上发生冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法启动Tkinter并运行以安装matplot lib.

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

我正在运行Mac OS X 10.4.11,并且刚刚安装了Python 2.6.4.

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

在进行了数次其他的斗争之后,要安装matlotlib仍然是我要完成的工作之一,尽管我的Mac中有Xcode和Python都提供了Tkinter,但我想它们没有安装在有用的地方?安装Python 2.6.4后,导入_tkinter失败.所以我从活动状态安装了Tcl 8.5.

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.

现在,我进入Tkinter测试:

Now, I make it to the Tkinter test:

Tkinter._test() 追溯(最近一次通话): 文件",第1行,在 _test中的文件"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py",行3746 根= Tk() init 中的文件"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py",第1645行 self._loadtk() _loadtk中的文件"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py",行1659 %(_tkinter.TK_VERSION,tk_version) RuntimeError:tk.h版本(8.4)与libtk.a版本(8.5)不匹配

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)

我知道您已经讨论了我在这里描述的确切错误: http://bugs.python.org/issue4017

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

但是这些错误是由于python的早期版本出现问题而引起的,在该版本中setup.py颠倒了查找位置的顺序.您上一篇文章中的建议是在setup.py中修复此顺序并重建python,但是我的setup.py已经看起来不错-它包括以下几行:

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): #_tkinter模块,使用框架.由于框架相当 #不同UNIX搜索逻辑不可共享. 从os.path导入连接存在 framework_dirs = [ '/Library/Frameworks', '/系统/库/框架/', join(os.getenv('HOME'),'/Library/Frameworks')

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...)

在此过程中,我将介绍尝试安装m matplotlib以防万一的时候发生的事情... matplotlib认为我有Tkinter 8.4(具有讽刺意味的是,在此之前,我仅安装了8.5,它总是说找不到Tkinter):

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

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

另外,这是我尝试构建matplotlib时遇到的错误:

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

powerpc-apple-darwin8-g ++-4.0.1:无法识别的选项'-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' i686-apple-darwin8-g ++-4.0.1:无法识别的选项-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk /usr/bin/ld:-syslibroot:指定相乘 collect2:ld返回1退出状态 /usr/bin/ld:-syslibroot:指定相乘 collect2:ld返回1退出状态 lipo:无法打开输入文件:/var/tmp//ccrblCgU.out(没有此类文件或目录) 错误:命令"g ++"失败,退出状态为1 make:*** [mpl_build]错误1

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

谢谢!

凯特琳

推荐答案

我认为以前提出的解决方案的重点是,Python在安装后会检测到Tk的正确版本和位置.我假设您在安装Python之后安装了Tk.当我使用.dmg安装程序重新安装Python2.6时,此问题已在我的计算机上解决.我不需要重建或任何东西.我希望这有帮助. :)

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. :)

这篇关于Tcl/Tk Tkinter版本8.4和8.5在Mac Os X 10.4.11和python 2.6.4上发生冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆