Python Tk框架 [英] Python tk framework

查看:97
本文介绍了Python Tk框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有python代码,它会产生以下错误:

I have python code that generates the following error:

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工具可以将二进制文件重新链接到 正确的框架,但是要解决此问题,我到底需要在Terminal中键入什么?

Some of my Tk extension libraries are linking against /System/Library/Frameworks instead of /Library/Frameworks when they are being compiled, I know The install_name_tool tool can re-link a binary to the correct framework, but what exactly do I need to type into Terminal in order to fix this problem?

推荐答案

我不完全知道如何重新链接库,但是我发现了此博客文章.这涉及相同的问题.在这种情况下,一切都是由于ActiveTcl与已安装的系统框架混乱所致.

I am not completely aware how to relink the libraries but I found this blog post. That deals with the same issue. In that case everything was cause due to ActiveTcl messing with the already installed System Framework.

他最终只是删除了非系统版本.这是一个极好的解决方案,但可能会奏效.

He ended up simply removing the non-System version. Its a drastic solution but it might work.

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

您也可以先将框架移到其他地方以进行测试,如果遇到任何问题,请稍后将其还原.

You could also move the Frameworks somewhere else first for testing purposes and if you break something restore them later.

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

这篇关于Python Tk框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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