S
Solara6mo ago
rob-vh

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
mariobuikhuizen
mariobuikhuizen6mo ago
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?
rob-vh
rob-vhOP6mo ago
Hi Mario, I just changed the word "first" into "frist" so obviously not a SYNTAX issue
mariobuikhuizen
mariobuikhuizen6mo ago
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)
rob-vh
rob-vhOP6mo ago
python 3.8.10, but as I stated, I was working with streamlit (last week) and streamlit noticed the file updates.
mariobuikhuizen
mariobuikhuizen6mo ago
Do you see "Re-executed app sol.py" in the terminal when you make a change and save?
rob-vh
rob-vhOP6mo ago
nope! this is all: solara run sol.py Solara server is starting at http://localhost:8765
mariobuikhuizen
mariobuikhuizen6mo ago
What does this output: python -c "import solara.server.reload as r;print(r.NO_WATCHDOG)" ?
rob-vh
rob-vhOP6mo ago
python -c "import solara.server.reload as r;print(r.NO_WATCHDOG)" False
rob-vh
rob-vhOP6mo ago
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
rob-vh
rob-vhOP6mo ago
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)
rob-vh
rob-vhOP6mo ago
rob-vh
rob-vhOP6mo ago
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:
rob-vh
rob-vhOP6mo ago
to the point of even checking the contents (I did not really change the file, I just added+deleted a blank, and saved).
MaartenBreddels
MaartenBreddels6mo ago
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
rob-vh
rob-vhOP6mo ago
Dat werkt helemaal goed, dank voor de vliegendvlugge fix.
Want results from more Discord servers?
Add your server