A way to tackle this could be to create another python file which is something like this
from <folder_name>.main import main
if __name__ == '__main__':
main()
And then use pyinstaller
on this file.
Also, make sure that you have an __init__.py
in all the folders with python files so that they are treated like packages when performing a relative import.
Reference posts [1] [2]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…