{"id":713,"library":"streamlit","title":"Streamlit","description":"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.","status":"active","version":"1.55.0","language":"python","source_language":"en","source_url":"https://github.com/streamlit/streamlit","tags":["data-science","web-app","dashboard","data-visualization","machine-learning","python"],"install":[{"cmd":"pip install streamlit","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Streamlit is a Python library and requires Python >=3.10. Current versions support Python 3.9 through 3.13.","package":"python","optional":false},{"reason":"Commonly used for data manipulation in Streamlit apps; often implicitly installed as a direct dependency.","package":"pandas","optional":true},{"reason":"Commonly used for numerical operations in Streamlit apps; often implicitly installed as a direct dependency.","package":"numpy","optional":true}],"imports":[{"note":"The conventional and recommended import alias is `st` for brevity and consistency across Streamlit applications.","wrong":"import streamlit","symbol":"streamlit","correct":"import streamlit as st"}],"quickstart":{"code":"import streamlit as st\n\nst.title('My First Streamlit App')\n\nname = st.text_input('What is your name?')\n\nif name:\n    st.write(f'Hello, {name}!')\n\nnumber = st.slider('Choose a number', 0, 100, 50)\nst.write(f'The number is {number}')\n\n# To run this app, save it as a .py file (e.g., app.py) and run `streamlit run app.py` in your terminal.","lang":"python","description":"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."},"warnings":[{"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.","message":"Streamlit'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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refactor authentication flows. For deployed apps, consider Streamlit Community Cloud's authentication features or custom solutions using `st.secrets` with external auth providers. ","message":"The `st.experimental_user` command has been removed. Access to user information might require alternative authentication methods or specific deployment configurations.","severity":"breaking","affected_versions":">=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)"},{"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.","message":"The `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.","severity":"deprecated","affected_versions":">=1.36.0 (deprecation warning added in 1.36.0)"},{"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.","message":"Widgets 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`.","severity":"gotcha","affected_versions":"All versions"},{"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`.","message":"`kwargs` support for `st.vega_lite_chart` is deprecated. Configurations should be passed via explicit parameters rather than keyword arguments.","severity":"deprecated","affected_versions":">=1.36.0 (deprecation added in 1.36.0)"},{"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.","message":"Streamlit 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always execute Streamlit applications using `streamlit run <script_name.py>`.","message":"Streamlit 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T18:13:29.526Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Run `pip install streamlit` in your terminal to install the library.","cause":"The Streamlit library is not installed in the current Python environment or the environment is not active.","error":"ModuleNotFoundError: No module named 'streamlit'"},{"fix":"Add `import streamlit as st` at the beginning of your Python script.","cause":"The Streamlit library has not been imported or aliased as 'st' before attempting to use Streamlit functions.","error":"NameError: name 'st' is not defined"},{"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()`.","cause":"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.","error":"StreamlitAPIException: st.sidebar() doesn't exist. Did you mean st.sidebar.button() or st.sidebar.write()?"},{"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.","cause":"You are attempting to access a key in `st.session_state` that has not yet been initialized or set, leading to a KeyError.","error":"KeyError: 'my_key' not in st.session_state"},{"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`.","cause":"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.","error":"streamlit run: command not found"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"1.57.0","install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"sdist","failure_reason":null,"install_time_s":null,"import_time_s":1.27,"mem_mb":24.1,"disk_size":"444.7M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.17,"mem_mb":21.1,"disk_size":"427.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":17,"import_time_s":0.54,"mem_mb":19.3,"disk_size":"414M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.43,"mem_mb":16.4,"disk_size":"398M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"sdist","failure_reason":null,"install_time_s":null,"import_time_s":1.77,"mem_mb":25.9,"disk_size":"465.3M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.83,"mem_mb":23.5,"disk_size":"448.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":15.9,"import_time_s":0.92,"mem_mb":21.3,"disk_size":"434M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.68,"mem_mb":18.4,"disk_size":"418M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"sdist","failure_reason":null,"install_time_s":null,"import_time_s":1.81,"mem_mb":25.6,"disk_size":"449.2M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.78,"mem_mb":22.7,"disk_size":"431.9M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":16.1,"import_time_s":1.12,"mem_mb":20.6,"disk_size":"418M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.93,"mem_mb":18.3,"disk_size":"401M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"sdist","failure_reason":null,"install_time_s":null,"import_time_s":1.68,"mem_mb":25.9,"disk_size":"447.8M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.69,"mem_mb":23.5,"disk_size":"430.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":15.1,"import_time_s":1.04,"mem_mb":21.4,"disk_size":"416M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.64,"mem_mb":19,"disk_size":"400M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"sdist","failure_reason":null,"install_time_s":null,"import_time_s":1.19,"mem_mb":19.4,"disk_size":"429.5M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.11,"mem_mb":19.4,"disk_size":"420.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":17.9,"import_time_s":0.52,"mem_mb":14.7,"disk_size":"407M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.47,"mem_mb":14.7,"disk_size":"399M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}