Convert Streamlit application to exe file

I have created a streamlit Application and I want to run as a standalone application in windows desktop by creating .exe file.

I tried using Pyinstaller library.

Steps followed:

  1. Created a simple application file app.py
  2. Installed pyinstaller library.
  3. Created app.spec file
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
    ['app.py'],
    pathex=[],
    binaries=[],
    datas=[],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    noarchive=False,
    optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.datas,
    [],
    name='app',
    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,
)

with details as shown in the file attached.
4. finally ran the command, pyinstaller app.spec

  1. This will create a app.exe file inside the directory dist

but when i run app.exe , it opens black window and closes.

Any idea please.
Thank you.