I’m New to Python Coding and just finished my first python scripted I’m trying to publish my programme so that I can install in on another device.
But as soon as I convert it from .py
to .exe
with pyinstaller and try to run my programme it gives me the error:
fatal error: failed to execute scrip
Code I used in to convert:
pyinstaller -w file_name.py
pyinstaller -F file_name.py
pyinstaller -i "c:\\icon_file path" file_name.py
am I just missing as step or is there something else I can try to resolve this problem? I usually code on Visual studio and when I test run everything worked fine.
My .spec
file:
block_cipher = None
a = Analysis(['file_name.py'],
pathex=['C:\\Users\\MainUser\\Desktop\\Publishing'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
a.binaries = a.binaries +
[('libsha1.dll','/home/iot/lib/libsha1.dll','BINARY')]
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='file_name',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True )
```