Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 'last_print_t' is preventing streamlit from reloading #98

Open
rohitsathish opened this issue Apr 10, 2024 · 1 comment
Open

[BUG] 'last_print_t' is preventing streamlit from reloading #98

rohitsathish opened this issue Apr 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rohitsathish
Copy link

Describe the bug

Traceback (most recent call last):
  File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\tqdm\std.py", line 1149, in __del__
    self.close()
  File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\stqdm\stqdm.py", line 109, in close
    super().close()
  File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\tqdm\std.py", line 1278, in close
    if self.last_print_t < self.start_t + self.delay:       
AttributeError: 'stqdm' object has no attribute 'last_print_t'

To Reproduce

A simple app with two stqdm instances will produce the error upon a few reruns.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Vivaldi
  • Version of streamlit : 1.33.0
  • Version of stqdm: 0.0.5
  • Version of tqdm: 4.66.1
@rohitsathish rohitsathish added the bug Something isn't working label Apr 10, 2024
@Wirg
Copy link
Owner

Wirg commented Apr 23, 2024

Hi @rohitsathish,

Thanks for reporting.

I was not able to reproduce with the following code.
It might be windows specific. In the past, I had some issues with Windows.
I don't have a windows machine currently but I could try again in a few weeks.

from time import sleep
from stqdm import stqdm

for item in stqdm(range(10)):
    sleep(0.1)

for item in stqdm(range(10)):
    sleep(0.1)

Can you try to reproduce with the above code?
If it fails in the same way, can you try again with adding this on top of your file.

from multiprocessing import RLock

from stqdm import stqdm
stqdm.set_lock(RLock())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants