Registry / web-framework / streamlit

streamlit

JSON →
library1.62.0pypypi✓ verified 25d ago

Streamlit is an open-source Python library that empowers developers to build and share interactive web applications for data science and machine learning with minimal code. It allows transforming Python scripts into beautiful, interactive apps in minutes, supporting various data libraries and visualizations. The current stable version is 1.55.0, with a regular release cadence bringing new features and improvements.

pip install streamlit
INSTALL
IMPORT
SIG · STREAMLIT
S
streamlit
web-frameworkpythonv1.62.0
Install
15.7s avg
Import
1254ms
Disk
441MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.62.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.634s · 457.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 15.7s · import 0.874s · 421MB
441MB installed
● package 441MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

streamlit
import streamlit as st
import streamlit
The conventional and recommended import alias is `st` for brevity and consistency across Streamlit applications.

This simple Streamlit app demonstrates how to create a title, a text input widget, and a slider. When a user interacts with a widget, Streamlit automatically reruns the script from top to bottom, updating the displayed output.

import streamlit as st st.title('My First Streamlit App') name = st.text_input('What is your name?') if name: st.write(f'Hello, {name}!') number = st.slider('Choose a number', 0, 100, 50) st.write(f'The number is {number}') # To run this app, save it as a .py file (e.g., app.py) and run `streamlit run app.py` in your terminal.
streamlit --version
Debug
Known issues
gotchaStreamlit's reactive model reruns the entire script from top to bottom on every user interaction or code change. Be mindful of expensive operations and use `st.cache_data` or `st.cache_resource` to memoize functions and prevent unnecessary re-execution. Not using caching for heavy computations can lead to slow app performance.
fix
Decorate functions with `@st.cache_data` for data-related computations or `@st.cache_resource` for resources like ML models, especially for functions that perform heavy calculations or data loading.
affects: All versions
breakingThe `st.experimental_user` command has been removed. Access to user information might require alternative authentication methods or specific deployment configurations.
fix
Refactor authentication flows. For deployed apps, consider Streamlit Community Cloud's authentication features or custom solutions using `st.secrets` with external auth providers. 
affects: >=1.36.0 (removed in 1.36.0, as of Dec 17 2025 release note which mentions 1.36.0 as a 'breaking change' release)
deprecatedThe `add_rows` command, used with `st.dataframe` or `st.table`, has been deprecated. While it may still function, its use is discouraged and it will eventually be removed.
fix
To update data in `st.dataframe` or `st.table`, re-assign the full, updated DataFrame to the component. Streamlit's diffing algorithm will efficiently update the display.
affects: >=1.36.0 (deprecation warning added in 1.36.0)
gotchaWidgets within `st.form` only submit their values and trigger a rerun when the `st.form_submit_button` is clicked. If you need immediate interaction, place widgets outside of a form. Also, `st.button` and `st.download_button` cannot be placed inside `st.form`.
fix
Design your app layout carefully, using `st.form` for batch inputs and direct `st.` calls for immediate interactivity. Do not put `st.button` or `st.download_button` inside a form. If a widget inside a form needs to trigger an immediate action, consider refactoring the logic or placing that specific widget outside the form.
affects: All versions
deprecated`kwargs` support for `st.vega_lite_chart` is deprecated. Configurations should be passed via explicit parameters rather than keyword arguments.
fix
Update your `st.vega_lite_chart` calls to pass chart configurations using dedicated parameters as specified in the Streamlit API reference for `st.vega_lite_chart`.
affects: >=1.36.0 (deprecation added in 1.36.0)
gotchaStreamlit applications must be run using the `streamlit run <script_name>.py` command. Running a script directly with `python <script_name>.py` will not properly initialize the Streamlit environment, leading to issues like session state not functioning, widgets not displaying correctly, and the app not being viewable in a browser. The `missing ScriptRunContext` warnings are also a symptom of this.
fix
Always run your Streamlit application using `streamlit run <your_script_name>.py` from your terminal. Avoid running Streamlit scripts directly with `python` or integrating them into non-Streamlit execution contexts without proper embedding.
affects: All versions
gotchaStreamlit applications must be run using the `streamlit run <script_name.py>` command. Running a script directly with `python <script_name.py>` will result in warnings about a missing `ScriptRunContext`, prevent session state from functioning correctly, and the app will not be viewable in a browser.
fix
Always execute Streamlit applications using `streamlit run <script_name.py>`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'streamlit'
The Streamlit library is not installed in the current Python environment or the environment is not active.
fix
Run `pip install streamlit` in your terminal to install the library.
NameError: name 'st' is not defined
The Streamlit library has not been imported or aliased as 'st' before attempting to use Streamlit functions.
fix
Add `import streamlit as st` at the beginning of your Python script.
StreamlitAPIException: st.sidebar() doesn't exist. Did you mean st.sidebar.button() or st.sidebar.write()?
Users mistakenly try to call `st.sidebar()` as a function to create a sidebar, but `st.sidebar` is an object used to access sidebar elements or a context manager.
fix
Use `with st.sidebar:` as a context manager to place multiple elements in the sidebar, or call specific methods like `st.sidebar.write()` or `st.sidebar.button()`.
KeyError: 'my_key' not in st.session_state
You are attempting to access a key in `st.session_state` that has not yet been initialized or set, leading to a KeyError.
fix
Initialize the key with a default value at the beginning of your script using `if 'my_key' not in st.session_state: st.session_state['my_key'] = default_value` before accessing it.
streamlit run: command not found
The `streamlit` command-line tool is not found in your system's PATH, typically because Streamlit was not installed or the Python environment where it's installed is not active.
fix
Ensure Streamlit is installed (`pip install streamlit`) and that your Python environment (e.g., virtual environment) is activated before running `streamlit run app.py`.
Upgrade
Version history
1.62.0latest on PyPI · released Aug 19, 2026
Audit
Dependencies
pythonrequiredStreamlit is a Python library and requires Python >=3.10. Current versions support Python 3.9 through 3.13.
pandasoptionalCommonly used for data manipulation in Streamlit apps; often implicitly installed as a direct dependency.
numpyoptionalCommonly used for numerical operations in Streamlit apps; often implicitly installed as a direct dependency.
Agent activity
30 hits · last 30 days
node
24
OpenAI (training)
1
Resources
streamlit — pip install streamlit · libregistry