How can I generate the exe application from python file [duplicate]

爱⌒轻易说出口 提交于 2019-12-13 08:03:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!