How to install python application with tkcalendar module by pyinstaller?

后端 未结 3 2005
耶瑟儿~
耶瑟儿~ 2020-11-30 14:36

I\'m trying to install python application on Windows with pyinstaller where I\'m using tkcalendar. Application is working but the tkcalendar.Calendar isn\'t.

When I\

3条回答
  •  萌比男神i
    2020-11-30 15:32

    The issue does not come from tkcalendar but from the fact that PyInstaller does not detect second level imports. A way to solve this issue is explained in tkcalendar's documentation in the HowTos section:

    When bundling an application with PyInstaller, there is an issue with the detection of the babel dependency of tkcalendar. This can be fixed by using the --hidden-import option:

    $ pyinstaller --hidden-import babel.numbers myscript.py
    

    or by editing the .spec file:

    hiddenimports=["babel.numbers"]
    

提交回复
热议问题