TK Framework double implementation issue

前端 未结 3 525
深忆病人
深忆病人 2020-12-31 10:52

I am testing out creating a GUI using the Tkinter module. I was trying to add an image to the GUI using PIL. My code looks like this:

import Tkinter as tk
fr         


        
3条回答
  •  暖寄归人
    2020-12-31 11:13

    I know I created the bounty, but I got impatient, decided to investigate, and now I've got something that worked for me. I have a very similar python example to yours, which pretty much does nothing other than try to use Tkinter to display an image passed on the command line, like so:

    calebhattingh $ python imageview.py a.jpg
    objc[84696]: Class TKApplication is implemented in both /Users/calebhattingh/anaconda/envs/py35/lib/libtk8.5.dylib and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
    objc[84696]: Class TKMenu is implemented in both /Users/calebhattingh/anaconda/envs/py35/lib/libtk8.5.dylib and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
    objc[84696]: Class TKContentView is implemented in both /Users/calebhattingh/anaconda/envs/py35/lib/libtk8.5.dylib and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
    objc[84696]: Class TKWindow is implemented in both /Users/calebhattingh/anaconda/envs/py35/lib/libtk8.5.dylib and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
    Segmentation fault: 11
    

    What's happening is that the binary file, ~/anaconda/envs/py35/lib/python3.5/site-packages/PIL/_imagingtk.so has been linked to a framework, and not the Tcl/Tk libs in the env. You can see this by using otool to see the linking setup:

    (py35)

提交回复
热议问题