我用cx_freeze冻结了一个python 3.6程序,它工作得很好。但只要我试图运行它,我收到了这个错误信息。
Python 3.6 cx_freeze ModuleNotFoundError:没有名为Tkinter的模块
有谁知道该怎么办?请帮忙!
我用cx_freeze冻结了一个python 3.6程序,它工作得很好。但只要我试图运行它,我收到了这个错误信息。
Python 3.6 cx_freeze ModuleNotFoundError:没有名为Tkinter的模块
有谁知道该怎么办?请帮忙!
尝试使用 进口Tkinter的 (小“T”,而不是资本)
如果您更清晰地读出错误,它在一个评论说,如果进口_tkinter失败,您的计算机未配置为使用Tkinter的。你应该下载tk和ttk来使它工作。
,并根据http://wiki.python.org/moin/TkInter:
If it fails with "No module named _tkinter" or "Tkinter", your Python configuration needs to be modified to include this module (which is an extension module implemented in C). Do not edit Modules/Setup (it is out of date). You may have to install Tcl and Tk (when using RPM, install the -devel RPMs as well) and/or edit the setup.py script to point to the right locations where Tcl/Tk is installed. If you install Tcl/Tk in the default locations, simply rerunning "make" should build the _tkinter extension.
我试过了。它在ImageTk.py文件中,当我改变它时不起作用 – Caleb
然后我认为tkinter模块没有安装。请检查并尝试安装它,如果它没有安装在cmd中使用此代码'python -m pip install tkinter' –