New Streamlit 1.23.1 doesn't refresh after script changes?

Summary

In the new version of Streamlit 1.23.1 the app is changing only after I cancel my current “streamlit run app.py” and run it again. In previous versions a simple refresh on the page would update the app in http://localhost:8501/ with the code. Am I missing something?

Debug info

  • Streamlit version: 1.23.1
  • Python version: 3.9.13
  • Using Conda? PipEnv? PyEnv? Pex? No to all
  • OS version: Windows 10
  • Browser version: Microsoft Edge 114.0.1823.37

Hey @DarkCSS,

Can you share a code snippet so we can try to reproduce this issue?

@Caroline sure. Here’s the code. Save it to script, say, “app.py” and use “streamlit run app.py” then, try to change some text inside the text strings and see if it changes:

import streamlit as st

# Tabs
tab1, tab2, tab3, tab4 = st.tabs(["TAB1",
                                  "TAB2",
                                  "TAB3",
                                  "TAB4"])

with tab1:
    col1, col2, col3 = st.columns(3)
    
    with col1:
        """
        ### Test
        
        """
        
    with col3:
        st.video("https://www.youtube.com/watch?v=R2nr1uZ8ffc")
    
    with col2:
        """
        ### Test2
        
        a table:
        """
        table_html = """
        <table id="my-table">
            <thead>
                <tr>
                    <th>Var 1</th>
                    <th>Var 2</th>
                    <th>Var 3</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>A</td>
                    <td>B</a></td>
                    <td>C</td>
                </tr>
            </tbody>
        </table>
        """
        
        st.markdown(table_html, unsafe_allow_html=True)
    with col2:
        """
        ### Test3
        Delete this line after run 1
        Delete this line after run 2
        """

@Caroline

I also noticed this error appears in my command prompt:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\threading.py", line 980, in _bootstrap_inner
    self.run()
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\watchdog\observers\api.py", line 204, in run
    self.dispatch_events(self.event_queue)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\watchdog\observers\api.py", line 380, in dispatch_events
    handler.dispatch(event)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\watchdog\events.py", line 276, in dispatch
    {
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\streamlit\watcher\event_based_path_watcher.py", line 374, in on_moved
    self.handle_path_change_event(event)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\streamlit\watcher\event_based_path_watcher.py", line 354, in handle_path_change_event
    new_md5 = util.calc_md5_with_blocking_retries(
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\streamlit\watcher\util.py", line 56, in calc_md5_with_blocking_retries
    content = _get_file_content_with_blocking_retries(path)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\streamlit\watcher\util.py", line 91, in _get_file_content_with_blocking_retries
    with open(file_path, "rb") as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\user\\Downloads\\test.py'

Hey @DarkCSS,

This is what happens when I run your app and edit the text:

Forum

What is test.py? Is that part of your app? If you adjust the permissions on that file, does the issue persist?

You’re right. I could not reproduce the problem on my home computer (had this problem at the office computer).

I’ll try to reinstall streamlit on the office computer and see if it works.

@Caroline

test.py is the script I’m running as a test to edit and see if it changes the app.

I tried to reinstall streamlit on my office computer but had no success in tackling this issue.

I think perhaps it could be related to admin rights problem in the version 1.23 of streamlit. On my home computer I have admin rights, but in the office computer I do not. The error I’m having is the one I posted above, the one which appears on the gif below.

Downgrading Streamlit from 1.23.1 to 1.22.0 with pip install --force-reinstall -v "streamlit<1.23.0" completely solves the issue as you can see on the second gif below. I’ll be doing that for now but I hope it gets fixed in 1.23 because I need the newer features like support for Altair 5.0

Streamlit 1.23.1:
streamlit

Streamlit 1.22.0:
streamlit2

Confirmed solution of the problem in new version of Streamlit 1.24.0.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.