简体   繁体   中英

Python tk framework

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.

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?

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/

I don't think simply deleting the frameworks is the best way to handle this issue. If indeed the frameworks are from an ActiveTcl installation, other files and links probably should be cleaned up. ActiveState provides an uninstall script to clean everything out; where to find it and how to use it is specified in the the ActiveTcl User Guide . Note that the script location depends on the OS X version.

If you've already deleted the frameworks and the uninstall script with them, you may want to look in /usr/local/bin for any executables (or stale links to executables) that ActiveTcl puts there (eg, wish , tclsh and tkcon ). To find anything there that links to the deleted framework locations, you could use something like ls -l | grep Tcl ls -l | grep Tcl or ls -l | grep Tk ls -l | grep Tk (but make sure any links you discover and intend to delete are to the 3rd party /Library locations, not to the /System/Library locations).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM