6

我有生成以下错误的python代码:

objc[36554]: Class TKApplication is implemented in both /Library/Frameworks/Tk.framework/Versions/8.5/Tk and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.

objc[36554]: Class TKMenu is implemented in both /Library/Frameworks/Tk.framework/Versions/8.5/Tk and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.

objc[36554]: Class TKContentView is implemented in both /Library/Frameworks/Tk.framework/Versions/8.5/Tk and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.

objc[36554]: Class TKWindow is implemented in both /Library/Frameworks/Tk.framework/Versions/8.5/Tk and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.

我的一些 Tk 扩展库在编译时链接到 /System/Library/Frameworks 而不是 /Library/Frameworks,我知道 install_name_tool 工具可以将二进制文件重新链接到正确的框架,但我到底需要什么输入终端以解决此问题?

4

2 回答 2

1

我不完全知道如何重新链接库,但我找到了这篇博文。这涉及相同的问题。在那种情况下,一切都是由于 ActiveTcl 与已安装的系统框架混淆所致。

他最终只是简单地删除了非系统版本。这是一个激进的解决方案,但它可能会奏效。

cd /Library/Frameworks
rm -r Tk.framework
rm -r Tcl.framework

您也可以先将框架移动到其他地方以进行测试,如果您破坏了某些东西,请稍后恢复它们。

http://michaelwelburn.com/2013/06/07/python-error-conflicting-tk-libraries-and-activetcl/

于 2013-06-27T09:05:51.320 回答
0

我不认为简单地删除框架是处理这个问题的最佳方式。如果框架确实来自 ActiveTcl 安装,则可能应该清理其他文件和链接。ActiveState 提供了一个uninstall脚本来清除所有内容;ActiveTcl 用户指南中指定了在哪里找到它以及如何使用它。请注意,脚本位置取决于 OS X 版本。

如果你已经删除了框架和卸载脚本,你可能想在 /usr/local/bin 中查找 ActiveTcl 放在那里的任何可执行文件(或到可执行文件的陈旧链接)(例如wishtclshtkcon)。要在那里找到链接到已删除框架位置的任何内容,您可以使用类似ls -l | grep Tclls -l | grep Tk(但请确保您发现并打算删除的任何链接都指向第 3 方 /Library 位置,而不是 /System/Library 位置)。

于 2014-05-19T05:34:34.270 回答