stqdm provides an easy-to-use progress bar for Streamlit applications, integrating the functionality of the popular `tqdm` library with Streamlit's `st.progress`. The current version is 0.0.5, released in January 2023, and the library is actively maintained for compatibility with newer Python, Streamlit, and tqdm versions, though with an irregular release cadence.
pip install stqdmVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use `stqdm` for a loop in the main Streamlit area and within the sidebar. Run this with `streamlit run your_script.py`.
As a workaround, you can explicitly set a lock for stqdm, especially when using `stqdm.pandas()`. Add `from threading import RLock; stqdm.set_lock(RLock())` at the top of your script. This helps prevent the app from entering an infinite loop.
Update to `stqdm` version 0.0.5 or newer, which properly provides time updates even for iterators without a length.
Monitor GitHub issues for official fixes. Consider refactoring to use a single `stqdm` instance where possible, or explore alternative Streamlit native progress handling if encountering this specific issue until a resolution is provided.
Ensure that `stqdm` updates happen within the main Streamlit script context. If using background threads, you might need to manually manage `streamlit.scriptrunner.add_script_run_ctx` or similar context propagation, or consider alternative methods for updating the Streamlit UI from threads.
pip install stqdm
Change your import statement from `from tqdm import stqdm` to `from stqdm import stqdm`.
Ensure the argument passed to `stqdm` is an iterable, for example, use `stqdm(range(10))` to iterate 10 times.
Add `from stqdm import stqdm` at the top of your Python script before using the function.
Install the library using the correct package name: `pip install stqdm`.