【发布时间】:2011-01-15 22:04:20
【问题描述】:
我无法启动和运行 Tkinter 以安装 matplot lib。
我正在运行 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() 回溯(最近一次通话最后): 文件“”,第 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) 不匹配
我知道您已经讨论了我在这里描述的确切错误: 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 = [ '/库/框架', '/系统/库/框架/', 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:无法打开输入文件:/var/tmp//ccrblCgU.out(没有这样的文件或目录) 错误:命令“g++”失败,退出状态为 1 make: *** [mpl_build] 错误 1
谢谢!!
卡特琳娜
【问题讨论】: