How to monitor the filesystem and have streamlit updated when some files are modified?

I have understood your problem. I reproduced the same problem in my environment. It’s true that streamlit application can detect file changes but do not reflect the changes in the application.

The reason is probably that the module that added whose watcher is added to session._local_sources_watcher._register_watcher is not reloaded when rerunning the main script after changes.

Looking at the code, I guess there is a hint in streamlit/script_runner.py at 064b7450be3b874fe5ee7a16442ab87bf9beb34e · streamlit/streamlit · GitHub . But I’m not familiar with ast, compile or exec

Anyone know how to re-import a library with ast, compile and exec?

1 Like