Watching custom folders

Say I have a folder structure like this

custom_py_package1
- __init.py__
- ...
custom_py_package2
- __init.py__
- ...
app
- streamlit_app1.py
- ...

I want to run apps from my app folder which uses custom_py_package1 and custom_py_package2. Now that all works fine but I’d like my apps to detect changes in my custom packages without restarting the app. How do I achieve this?

1 Like

Hi @mr-bjerre, thanks for your question. By default Streamlit only watches modules within the directory of the main script file. In your case, that would be app.

Nevertheless, Streamlit also watches modules in the PYTHONPATH. So setting the PYTHONPATH to include the modules you want to track should help you.

See this PR: https://github.com/streamlit/streamlit/pull/845

Best,
Matteo