Search code examples
pythonpython-3.xpyinstaller

What is the build folder and spec file when making exe file using pyinstaller?


Q1. When I create an exe file with the pyinstaller, a build folder and a spec file are created, what are these?

Q2. Is there no problem in running exe file even if I delete these?

Q3. Or do I have to distribute these together when I distribute exe file to other computers?

Q4. additionally, what is the dist folder?

When I delete build folder, spec file and dist folder, the exe file executes well on my computer.


Solution

    1. They are like temporary files and configuration files for PyInstaller. For a little advanced usage you can modify or manually create spec file with special instructions for build ..like modules to be included or excluded etc.
    2. Yes after exe is generated you can erase them, keeping them usually speeds up your next build
    3. you dont have to distribute them with exe.
    4. unless its a standalone, you will need all files in dist folder along with exe for the program to execute on your computer. In case you built it as standalone you will need, exe file only.