Not able to run the Streamlit app

Hi,

I have a python project using Streamlit app. I have used poetry to build a package. After install using pip install. Trying to launch the app gives the following error.

WARNING streamlit.runtime.scriptrunner_utils.script_run_context: Thread ‘MainThread’: missing ScriptRunContext! This warning can be ignored when running in bare mode.

How do I package the Streamlit app in a python project and make it installable in local systems and launch the app.

You can upvote the feature request on GitHub: Make Streamlit easy to deploy as a standalone executable (e.g. PyInstaller, Electron) · Issue #1370 · streamlit/streamlit · GitHub

Otherwise, there are multiple threads discussing different approaches people have taken, with various pros and cons depending on what you are trying to accomplish: Using PyInstaller (or similar) to create an executable

I put together a minimal example of a streamlit app that you can install as a pip package.

You can install from github:

pip install git+https://github.com/goyodiaz/packaged-streamlit-app 

or from a checkout, build a wheel, etc.

Once it is installed, you can run it with either myapp or python -m myapp.

It relies on undocumented features, but it is based on the same way streamlit itself runs applications. So, if it ever breaks, look at what is in streamlit.__main__.

1 Like