我通过Anaconda运行Python2.7,据我所知没有安装Python 3。我对导入tkinter感到困惑。这里关于堆栈溢出的其他几个问题表明,根据您是运行Python2还是Python3,tkinter有单独的模块和略有不同的导入语法。# These work fine in Python 2, as they should, even if compiled into an exe.
from Tkinter import *\\tki
每次我试图运行import matplotlib时,都会出现错误ImportError: No module named Tkinter。/site-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>ImportError: No module named Tkinter
我试图安装tk.x86_64和tk-devel.x86_64包
我正在编写一个tkinter程序,它使用一些JPG文件作为背景。但是,我发现当使用"pyinstaller“将脚本转换为.exe文件时,用于tkinter窗口的图像不会编译/添加到.exe文件中。我想使用这个解码的图像数据作为图片和显示作为标签/按钮在tkinter。它显示以下错误- File "test.py", line 23, in <module>