i have this .spec file that i use to convert my python project into an executable, the command works just fine however the command generates a folder with a lot of files (the executable among them) but i want it to generate a standalone executable file
Command:
pyinstaller main.spec
main.spec file:
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(
['main.py', 'ui_interface.py', 'utilities.py', 'data.py'],
pathex=[],
binaries=[],
datas=[('MainMenu.ui', '.'), ('style.json', '.'), ('resources_rc.py', '.')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='D&PO UIB', # Set the name of the executable to "D&PO UIB"
debug=True, # Enable debug output
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False, # Set console to False to remove the console window
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
onefile=True, # Generate a single executable file # Add the path to your icon file
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[], # Include the upx_exclude parameter with an empty list
name='D&PO UIB', # Set the name of the executable to "D&PO UIB"
)
As you can see the onefile parameter is set to True but still nothing, i tried changing a lot of parameters and i tried a lot of methods that chatgbt requested but none of them work, it keeps generating a folder with plenty of files.