takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
894 stars 119 forks source link

Streamlit application installer - application python file not present in the installed location #266

Open DiptenduIDEAS opened 1 month ago

DiptenduIDEAS commented 1 month ago

I have the following code in run_app.py

def main():

    # Getting path to python executable (full path of deployed python on Windows)
    executable = sys.executable

    path_to_main = os.path.join(os.path.dirname(__file__), "home.py")

    # Running streamlit server in a subprocess and writing to log file

However, in the installed folder (or its subfolders), the file home.py is missing

image

The run_app.py file is found in the Python folder

Where is the home.py file?

Here is the snippet from installer.cfg

[Application]
name=XInsight
version=0.1
# How to launch the app - this calls the 'main' function from the 'myapp' package:
entry_point=run_app:main
icon=IDEAS-TIH.ico

[Python]
version=3.10.0
bitness=64

and this is the source structure

image

DiptenduIDEAS commented 1 month ago

Sorry, the run_app.py file was found in the pkgs folder after installation, not in Python folder

image

takluyver commented 1 month ago

Have you had a look at the streamlit example? I think your home.py is equivalent to app.py in the example

This is a guess, but you might want to put your .py files in a packge, like in that example. If you don't, then Pynsist doesn't know that run_app.py and home.py are connected, so you'd have to tell it to include both, and any other relevant files.