Deploy streamlit in python src layout app


is there a way to run app from an installed python app using src layout installed via pip ?

I tried this :

streamlit run my_python_app

in my pyproject.toml, I have the following entrypoint

my_python_app = "streamlit run my_python_app.command_line:main" is the file which launch the streamlit code. If I launch it via this command it works locally :

streamlit run src/my_python_app/

Do you know any way to do this ?


Hi @fledref

It seems you want to launch a Streamlit app from another script file.

Here’s a simple solution that you can implement by creating a file:

import subprocess

process = subprocess.Popen(["streamlit", "run", ''])

Then in the command line, you can run python and that should launch your Streamlit app. You can also insert os.path.join() into the input argument if your app file is not in the same folder.

Hope this helps!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.