I am creating an exe file using pyinstaller, with python version 3.8.1 but my results vary, the exe itself works but the file size is slightly different each time.
The build is executed using a '.spec' file with the following contents:
# -*- mode: python ; coding: utf-8 -*-a = Analysis( ['app.py'], pathex=[], binaries=[], datas=[("config.txt", ".")], hiddenimports=["paths"], hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], noarchive=False,)pyz = PYZ(a.pure)exe = EXE( pyz, a.scripts, a.binaries, a.datas, [('v', None, 'OPTION')], name='TOOL', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=True, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, codesign_identity=None, entitlements_file=None, icon="app_icon.ico",)
An example of the size difference: a first test build was 47,276,822 bytes while the second one was 47,276,805. The source code was obviously unchanged and the time between each build was only two minutes. I am also using a python virtual environment.
Note these sizes were determined using "Beyond Compare 4" 64 bit edition version 4.4.7 and I am on Windows 10 enterprise.