1

I am trying to use pyinstaller to create an installer for my python program, which is typically run as follows:

python -m <folder_name>

( I can't run by calling __main.__py) Inside <folder_name> I have __main__.py, an empty __init__.py, and various folders containing python code.

I don't see any options in the pyinstaller documentation to support this type of program structure. Are there options for this?

1 Answer 1

1

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]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.