Opinion: pyinstaller onefile or onedir for program distribution?

Hi everyone, this is my first topic in this forum and also I am relative new to the Python world (2 years coding) now it’s time to distribute a simple but profesional app that I had written over some windows users (10 and 11 version). And now it comes several new questions, but the first one is: which is better for this approach: onefile or onedir using pyinstaller? I asume that onefile is not the better because my exe file has 120MB size. Is there any risks if I send my app in onedir mode? Which is the standard and professional preferences to distribute python apps in this 2026?

Thank you.

(PyInstaller maintainer here)

I would not recommend onefile mode to anyone. It’s a honeypot we’ve been trying to wean people off for years. No one should want the crazy nonsense on their computers that it has to pull to make self extracting applications still half work on an OS that actively encourages security software to intercept, sabotage and and even side-load DLLs into any process that dares to touch the file system.

If you absolutely must have a single file without an archive or installer then try PyOxidiser which makes real[1] single file executables.

That depends on whether you’re most interested in hype, official Microsoft-approved standards, reality-approved standards, whatever modern means this day of the week or the thing actually working.

Zip files are the most simple, the most reliable and the most underated. Innosetup looks more professional and is old enough that it actually works for the Windows that is rather than the Windows that people imagine. MSIX is the shiny new modern thing – I’ve not seen it used enough in anger to know if it truly works.


  1. No cheating with a self extracting archive ↩︎

3 Likes

Thank you very much for your response I will follow your suggestions.

I generate the onedir version and then package that into a Windows installable .exe using Inno Setup Inno Setup

1 Like

Thank you, I have done yesterday just it and now I am currently testing the installer in other versions of windows.