'How to make a standalone installer for Python project which includes Python installation

I have a Python project which has following directories and files:

PythonProject
    -> configs
        -> appconfig.json
    -> logs
        -> applog.log
    -> output
        -> output file1
        -> output file2
    -> src
        -> file1.py
        -> file2.py
        -> file3.py 
    app.py 

I have app.py which is the main starting point of the project. It is depended on Python files in src and also depended on configs, logs and output directories.

I want to create an installer for this so that we have setup.exe which user can run and all the files and directories and stored somewhere in Program Files. This I can do by using pyinstaller on app.py and rest of the Python files can be converted to binaries. Finally I can use Inno Setup to pack everything and create setup.exe.

But the problem is that the whole application is built in Python and the users who are going to use it have no idea about installing Python and its packages. So I am looking for a solution in which I can also pack Python installer so that once a user is installing the software, Python is installed first and then its related Python packages and then finally our project. How can I achieve this? Can anyone please guide me on this?



Solution 1:[1]

The PyInstaller includes Python already:
https://pyinstaller.org/en/stable/operating-mode.html

Then it collects copies of all those files – including the active Python interpreter! – and puts them with your script in a single folder, or optionally in a single executable file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1