I have a python project inside “venv” folder and it contains my python files and non-project folder which is “ActiveDirectory” referring to Active Directory PowerShell module.
So when I build using this command:
pyinstaller --onefile --windowed --add-data "ActiveDirectory;." --icon=VodaPrint_Logo.png VodaPrint-Express.py
I found that the module is not loaded until I copied the folder beside the exe file, After that it works.