问题
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?
回答1:
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/
回答2:
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 (e.g., wish
, tclsh
and tkcon
). To find anything there that links to the deleted framework locations, you could use something like ls -l | grep Tcl
or 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).
来源:https://stackoverflow.com/questions/17327407/python-tk-framework