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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.634s · 457.7MB
glibcpy 3.10–3.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.fixDecorate 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.fixRefactor 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.fixTo 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`.fixDesign 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.fixUpdate 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.fixAlways 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.fixAlways 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.
fixRun `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.
fixAdd `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.
fixUse `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.
fixInitialize 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.
fixEnsure 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.