【问题标题】:Error message when launching exe, with tkcalendar使用 tkcalendar 启动 exe 时出现错误消息
【发布时间】:2020-03-23 06:09:43
【问题描述】:
from tkcalendar DateEntry
from tkinter import *
root=Tk()
root.title("Date picker")
d=DateEntry(root)
d.pack()
root.mainloop()
当我试图打开它的可执行文件时,启动“”时出现错误消息,我的脚本名称是 dd
(我使用 Auto_py_to_exe 来转换我的 python 文件)
【问题讨论】:
标签:
python
tkinter
tkcalendar
【解决方案1】:
我发现了您的脚本的错误和问题。
- 您没有导入 DateEntry
from tkcalendar import DateEntry
from tkinter import *
root=Tk()
root.title("Date picker")
d=DateEntry(root)
d.pack()
root.mainloop()
- 当您将脚本转换为 exe 时,您会看到缺少一个模块。如果您想检查缺少的模块,请在命令提示符下运行。
pyinstaller -F dd.py
它会告诉你'babel.numbers'模块丢失了。
现在来解决这个问题。
使用以下在线工具自动导入模块并将您的 .py 脚本转换为 .exe。
pyinstaller.exe --hidden-import babel.numbers dd.py