问题
I'm trying to get the .exe file from this script using pyinstaller
I used this command pyinstaller -w -F test.py while I'm in the test directory
the file test.py contains
from tkinter import *
from tkcalendar import DateEntry
root = Tk()
date = DateEntry(root, year=2001, month=11, day=11, width=17,)
date.pack()
root.mainloop()
The .exe file that I get is not WORKING?
when I do this pyinstaller -F test.py I get the error of no module named babel.numbers on the console
回答1:
It seems that PyInstaller can't resolve module babel.numbers
for tkcalendar
. One easy way is to use hidden-import:
pyinstaller -F --hidden-import "babel.numbers" test.py
来源:https://stackoverflow.com/questions/56902929/how-can-i-generate-the-exe-application-from-python-file