3

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

j_4321
  • 15,431
  • 3
  • 34
  • 61
Ali
  • 687
  • 8
  • 27

1 Answers1

14

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
Masoud Rahimi
  • 5,785
  • 15
  • 39
  • 67
  • Use a [virtualenv](https://docs.python-guide.org/dev/virtualenvs/) install Pyinstaller and `tkcalendar`. Also, put a `print` statement on the first line and make sure that you see it in console output (remember to **don't use `-w` flag). – Masoud Rahimi Jul 06 '19 at 10:08
  • thanx it worked without virtual envirenment – Ali Jul 07 '19 at 09:24