JBM 发表于 2022-10-3 20:56:37

tkinter.TclError: image "pyimage2" doesn't exist

各位大佬,新手真心求助,出现下面情况是什么原因,该如何解决呀?
Traceback (most recent call last):
File "G:\Easygui\晒晒国之重器.py", line 20, in <module>
    a=g.buttonbox("请选择要了解的国之重器","晒晒咱的国之重器",("对","错"),("对.png","错.png"))
File "D:\软件\Python安装\lib\site-packages\easygui\boxes\button_box.py", line 95, in buttonbox
    bb = ButtonBox(
File "D:\软件\Python安装\lib\site-packages\easygui\boxes\button_box.py", line 147, in __init__
    self.ui = GUItk(msg, title, choices, images, default_choice, cancel_choice, self.callback_ui)
File "D:\软件\Python安装\lib\site-packages\easygui\boxes\button_box.py", line 279, in __init__
    self.create_images(images)
File "D:\软件\Python安装\lib\site-packages\easygui\boxes\button_box.py", line 463, in create_images
    this_image['widget'].configure(image=this_image['tk_image'])
File "D:\软件\Python安装\lib\tkinter\__init__.py", line 1646, in configure
    return self._configure('configure', cnf, kw)
File "D:\软件\Python安装\lib\tkinter\__init__.py", line 1636, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: image "pyimage2" doesn't exist

Twilight6 发表于 2022-10-3 21:30:44



一个 Tkinter 程序只能有一个根窗口,看看你代码中是否使用了多个根窗口即 Tk() ?

页: [1]
查看完整版本: tkinter.TclError: image "pyimage2" doesn't exist