How to execute streamlit run command using subprocess

I have created a streamlit app in snowflake. I am using 1.26 version of streamlit in snowflake. I have a button in my page(main.py) on clicking it i am opening a new page(new_req.py). To achive this i used subprocess.run([“streamlit”,“run”,“new_req.py”]) in my main.py file. I am able to run this code successfully in my local. on clicking the button it is running streamlit command and opening new_req.py as a separate streamlit app. But same code when i deploy and run it in snowflake i am getting below error.
"PermissionError: [Errno 1] Operation not permitted: ‘streamlit’
Can someone please help to solve this.

Hi @Ameerulla_Shaik

Running subprocess.run command would spawn a Streamlit app and this may not be supported, please refer to this Streamlit in Snowflake Docs page for more info:

https://docs.snowflake.com/en/developer-guide/streamlit/owners-rights

Hi @dataprofessor Can you please help me on how to achieve this functionality in snowflake with the streamlit app features. I have to deploy this in snowflake since it access snowflake data.

Hi @Ameerulla_Shaik

You may find additional information on overcoming this by exploring permissions related to creation of “Streamlit objects” in the Snowflake Docs on Privileges required to view a Streamlit app:

https://docs.snowflake.com/en/developer-guide/streamlit/about-streamlit

Hope this helps!