ManintheArena
ManintheArena

Reputation: 11

holidays module not found in exe file pyinstaller

I coded a small project in Python using tkinter GUI and the module holidays. I am thus using pyinstaller through anaconda to generate an unique .exe file for my python script. I used a virtualenv generated through ananconda for the entire project and am using the modules: pandas and holidays

I launched pyinstaller a first time and ran into an issue that was: no module named openpyxl found which I was able to solve using stackoverflow. The following command solved it: pyinstaller main.py --hidden-import openpyxl.cell._writer -w

However, after that i got the same kind of error with holidays module:

Traceback (most recent call last): File "kiesel_gui.py", line 3, in <module> import kiesel_simulator File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "kiesel_simulator.py", line 5, in <module> import seasonality_builder as src File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "seasonality_builder.py", line 4, in <module> import holidays ModuleNotFoundError: No module named 'holidays'

I was not able to find any thread on here related to the holidays module and pyinstaller so I just modified the previous command: pyinstaller main.py --hidden-import openpyxl.cell._writer --hidden-import holidays -w

This does not work unfortunately, i still get the same error when i launch my application file. Can anybody help me please and tell me what i am doing wrong here? Thanks a lot

I modified the command that worked for openpyxl in vain

Upvotes: 0

Views: 906

Answers (1)

Joanna
Joanna

Reputation: 1

you can try with --hidden-imports:

hiddenimports=['holidays', 'holidays.utils', 'holidays.calendars', 'holidays.countries', 'holidays.groups']

this solves my problem.

Upvotes: 0

Related Questions