I tried pyinstaller along with other stuff like psutil, and all of them work perfectly fine until you add more than one file to the question. How can I build an entire project, like a folder into an executable file?
Commands I tried:
pyinstaller Main.py
pyinstaller --onefile Main.py
psutil Main.py
None work. No errors when running the project through python with the command-line. Screen instantly closes [due to the build problems]. I started the Main.py file using the CMD and it gets the info from other files and works perfectly fine.
Spec file:
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['Main.py'],
pathex=['C:\Dev\Python\ElexEngine\Source'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
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,
a.binaries,
a.zipfiles,
a.datas,
[],
name='Main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True )```
question from:
https://stackoverflow.com/questions/65599431/cant-convert-project-to-an-executable-in-python 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…