Closed Areef-abhiram closed 5 years ago
I think a similar issue (#32) has already been reported and I wrote a section in the documentation https://tkcalendar.readthedocs.io/en/stable/howtos.html#pyinstaller to address it. Have you tried it?
I had the same problem. According to https://tekrecipes.com/2019/04/17/modulenotfounderror-no-module-named-babel-numbers/ I fixed this by adding from babel.numbers import *
to the calendar.py
. Maybe it is worth to consider adding this import permanently.
@VShkaberda The issue is not directly related to tkcalendar, it comes from the fact that Pyinstaller does not detect second level imports. There is a solution to fix it by giving explicit import instructions to Pyinstaller. Since not everybody using tkcalendar uses Pyinstaller I won't add unnecessary imports into tkcalendar's code.
I was able to get tkcalendar into an exe with pyinstaller by adding data:
--add-data "<path to python>/Lib/site-packages/tkcalendar;tkcalendar"
--add-data "<path to python>/Lib/site-packages/babel;babel"
This included babel/numbers.py
which seemed to solve the problem, or you can manually copy-paste it from site-packages (no need to add data babel).
after generating the .exe by using pyinstaller im facing "no module named tkcalendar" some times and some times "no module named babel.numbers" .kindly help me to get out from this issue