'Pyinstaller --splash option not doing anything

I have an app that I have been packaging with Pyinstaller. Everything was working perfectly but when I added the option --splash IMAGENAME.png no splash screen appeared. I'm running the following command in the terminal in order to compile the app: pyinstaller --splash sps.png -F main_gui_ver.spec

My .spec file is as follows:

block_cipher = None


a = Analysis(['main.py'],
             pathex=['C:\\Users\\IRDGFRM\\OneDrive-Deere&Co\\OneDrive - Deere & Co\\Documents\\Python Projects\\Bot Creacion de Pedidos'],
             binaries=[],
             datas=[('C:\\Users\\IRDGFRM\\OneDrive-Deere&Co\\OneDrive - Deere & Co\\Documents\\Python Projects\\Bot Creacion de Pedidos\\venv\\Lib\\site-packages\\ttkbootstrap', 'ttkbootstrap'),],
             hiddenimports=['ttkbootstrap', 'importlib.resources', 'PIL.ImageFont', 'tkinter.font', 'openpyxl', 'pymssql'],
             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,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name='AutomatizacionSAP v3.3',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=True,
          disable_windowed_traceback=False,
          target_arch=None,
          codesign_identity=None,
          entitlements_file=None,
          icon='Resources/application.ico')


Solution 1:[1]

From what I found you need to specify the --splash IMAGE_FILE during the .spec file creation. It doesn't work if you simply add the --splash option to the pyinstaller command for a spec file previously created without the option. I found this also to be the case for the -F or --onefile option.

Be sure to include the path to the image file if it's not located in the same directory as the resultant .spec file and then try creating the .spec file with:

pyi-makespec --splash sps.png -F main_gui_ver.spec

You should see an additional block in the .spec file relating to the splash, and then you can compile with your original command: pyinstaller --splash sps.png -F main_gui_ver.spec

See the docs for more info: https://pyinstaller.readthedocs.io/en/stable/spec-files.html#the-splash-target

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pppery