Import file auto refresh

I organized my code in two files 1) 2) Where is primarily streamlit UI interface to take input and display output . where is functional code for the app .
import streamlit as st
import logic as lg

running streamlit app

streamlit run

Without stopping the streamlit server , when changes are made to , streamlit identifies the modificaton to the and ask for rerun

However , when changes are made to , i have to stop the server and restart streamlit app to reflect the changes in .

Is there a way streamlit can autorefresh changes in import files ( to avoid stop and restart of app)?

Hey @dataexplorer,

is the directory structure for your code as follows:

----> <ā€” your Streamlit interface
----> <ā€” code that does things

Then, as you said you import logic as lg into your file. But when you update logic, the app does not auto refresh like it does with your main script?

Can you answer these questions for me:

  • Streamlit version
  • Pip / conda version
  • computer IOS
  • default webbrowser


Yes , you got the directory structures right and also the issue

streamlit version : 0.75
pip 20.2.4
IOS : Win10
Webbrowser : Chrome

1 Like

Hey @dataexplorer,

I just wanted to checkin and let you know we are taking a look at this. I will update you when we know more about what is going on!


1 Like

Hi Marisa, I am having the same issue in Streamlit version 0.80.0, pip 20.0.2, Ubuntu 20.04

I have the same problem with the latest version on Ubuntu and Chrome.

I have the same problem on 0.84.0 in Ubuntu (in a docker container) viewed on Chrome and Firefox