automatic reload not working (new user) (fixed)
I have just installed solara on linux mint 20.3 (based on ubuntu 20.04).
I have a sol.py on local directory (a copy of apps/tutorial-streamlit.py) and started solara run sol.py in a terminal window as suggested in the tutorial. My firefox opens automatically and I see the first web page. Great. Success at the first attempt.
I modify the file (locally) and save. The browser window is not refreshed, I see no message in the terminal window.
I check ls -l and the time stamp of sol.py was changed.
I open a 2nd session with localhost:8765 and (of course) the same old app is shown.
When I do the same with streamlit run main.py the streamlit app window refreshes.
1. should the app refresh? I did not specify --production
2. is there some way to figure out why I do not get a new window?
Note: I had only done pip3 install solara, and apps/tutorial-streamlit.py complained that it could not find the markdown module. It worked after pip3 install markdown ... Is that as expected?
16 Replies
yeah, the app should show the changes (this does not require a refresh of the page nor a new window)
What is the change you made?
Hi Mario, I just changed the word "first" into "frist" so obviously not a SYNTAX issue
yeah, that should indeed work.
Which python version are you using?
(if you're using the systems version of python, that can sometimes be very old)
python 3.8.10, but as I stated, I was working with streamlit (last week) and streamlit noticed the file updates.
Do you see "Re-executed app sol.py" in the terminal when you make a change and save?
nope!
this is all:
solara run sol.py
Solara server is starting at http://localhost:8765
What does this output:
python -c "import solara.server.reload as r;print(r.NO_WATCHDOG)"
?python -c "import solara.server.reload as r;print(r.NO_WATCHDOG)"
False
I have now switched on --log-loglevel debug
I updated .../henri/pyracf_browser/sol.py using geany (and when that didn't show up, I used text edit)
I can see a .goutputstream update in the directory, but no access to sol.py
when I go into the terminal window and do a touch sol.py there is a reaction, and the app window changes.
however! when I do the exact same things with streamlit run, using either geany or text edit, streamlit notices and shows the 'rerun' option (or does auto-rerun if so configured)
when I do the same with streamlit run --logger.level debug main.py
2024-07-03 12:26:46.884 Watcher created for /home/rob/Documents/henri/pyracf_browser/make_stylable.py
2024-07-03 12:26:46.885 Watcher created for /home/rob/Documents/henri/pyracf_browser/field_spec.py
and update main.py using geany, I see that streamlit ignores the .goutputstream update but then proceeds to check the status of tracked files in the directory:
to the point of even checking the contents (I did not really change the file, I just added+deleted a blank, and saved).
Thank you for the very details reporting, this made it easy for me to understand, and fix this: https://github.com/widgetti/solara/pull/702
maartenbreddels
<:pull_open:882464248721182842> [widgetti/solara] Fix reload after file move
No description provided.
Created