为了安装 matplot lib,我无法启动和运行 Tkinter。
我正在运行 Mac OS X 10.4.11,并且刚刚安装了 Python 2.6.4 。
经过其他几场战斗,我安装 matlotlib 剩下的一场战斗是拥有一个 Tkinter 的工作版本,尽管我的 Mac 中有几个来自 Xcode 和 Python,我猜它们只是没有安装在有用的地方?安装 Python 2.6.4 后,导入 _tkinter 失败。所以我从活动状态安装了 Tcl 8.5。
现在,我参加了 Tkinter 测试:
Tkinter._test() Traceback(最近一次调用最后):文件“”,第 1 行,在文件“/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py”中,第 3746 行,在 _test root = Tk() 文件“/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py”,第 1645 行,在init self._loadtk( ) 文件“/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py”,第 1659 行,在 _loadtk % (_tkinter.TK_VERSION, tk_version) RuntimeError: tk.h version (8.4) 与 libtk.a 版本 (8.5) 不匹配
我意识到你已经讨论了我在这里描述的确切错误:http: //bugs.python.org/issue4017
但这些错误是由早期版本的 python 的问题引起的,其中 setup.py 颠倒了查找位置的顺序。您上一篇文章中的建议是在 setup.py 中修复此顺序并重建 python,但我的 setup.py 已经看起来不错 - 它包括以下几行:
def detect_tkinter_darwin(self, inc_dirs, lib_dirs): # _tkinter 模块,使用框架。由于框架完全不同,UNIX 搜索逻辑是不可共享的。from os.path import join, 存在 framework_dirs = [ '/Library/Frameworks', '/System/Library/Frameworks/', join(os.getenv('HOME'), '/Library/Frameworks')
我真的很感激任何关于如何处理这个问题的见解!(我是一名生物学家......)
当我在做的时候,我会在我尝试安装 m matplotlib 时会发生什么,以防它有用...matplotlib 认为我有 Tkinter 8.4(具有讽刺意味的是,只有在我安装 8.5 之后,它总是说它找不到 Tkinter):
Tkinter:Tkinter:65971,Tk:8.4,Tcl:8.4
另外,这是我在尝试构建 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: can' t 打开输入文件:/var/tmp//ccrblCgU.out(没有这样的文件或目录)错误:命令“g++”失败,退出状态为 1 make:*** [mpl_build] 错误 1
谢谢你!!
卡特琳娜