Registry / web-framework / dash
library4.4.1pypypi✓ verified 26d ago

Dash is a Python framework for building analytical web applications. Developed by Plotly, it allows users to create interactive dashboards and data visualization tools entirely in Python, without requiring JavaScript or web development expertise. It is currently at version 4.1.0 and typically releases minor versions and release candidates regularly, leading up to major version updates.

pip install dash
INSTALL
IMPORT
SIG · DASH
D
dash
web-frameworkpythonv4.4.1
Install
8.8s avg
Import
1065ms
Disk
168MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.4.1 · 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.915 runs
installs and imports cleanly · install 0.0s · import 1.109s · 160.6MB
glibc
py 3.103.915 runs
installs and imports cleanly · install 8.8s · import 1.021s · 164MB
168MB installed
● package 168MB
Code
Verified usage

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

Dash
from dash import Dash
html
from dash import html
dcc
from dash import dcc
Input, Output, State, callback
from dash import Input, Output, State, callback
from dash.dependencies import Input, Output, State
The `dash.dependencies` module is deprecated. Since Dash 2.0, `Input`, `Output`, `State`, and the `callback` decorator are imported directly from the `dash` package.

This quickstart demonstrates a basic Dash application with a single button and a division that updates its text when the button is clicked. It uses modern Dash imports and the `@callback` decorator, including `prevent_initial_call` to avoid errors on initial page load.

import os from dash import Dash, html, dcc, Input, Output, State, callback # Initialize the Dash app # For deployment, consider setting up a robust WSGI server (e.g., Gunicorn) # and handling config via environment variables. app = Dash(__name__) app.layout = html.Div([ html.H1("Dash Quickstart App"), html.Button("Click Me", id="my-button", n_clicks=0), html.Div(id="my-output", children="No clicks yet.") ]) # Define a callback to update the output based on button clicks @callback( Output("my-output", "children"), Input("my-button", "n_clicks"), State("my-output", "children"), prevent_initial_call=True # Prevents the callback from firing on initial load ) def update_output(n_clicks, current_text): if n_clicks is None: # This branch might be reached if prevent_initial_call=False return "No clicks yet." return f"Button has been clicked {n_clicks} times!" # Run the app if __name__ == "__main__": # In production, set debug=False and use a production-ready WSGI server app.run_server(debug=True)
Debug
Known issues
deprecatedThe `dash.dependencies` module for importing `Input`, `Output`, `State` is deprecated. These symbols, along with the `callback` decorator, should now be imported directly from the `dash` package.
fix
Change `from dash.dependencies import Input, Output, State` to `from dash import Input, Output, State, callback`.
affects: >=2.0.0
breakingDash Core Components (DCC) underwent a significant redesign in Dash v4.0.0. This might introduce breaking changes to component properties, styling, or internal structure for applications upgrading from older versions.
fix
Consult the official Dash documentation and component property references for updated usage. Thoroughly test existing applications after upgrading to v4.0.0 or later.
affects: >=4.0.0
gotchaBy default, Dash callbacks fire immediately upon application load. This can lead to errors if input components have not yet been rendered or populated with initial values (e.g., `None` where a string or number is expected).
fix
Set `prevent_initial_call=True` in your `@app.callback` decorator to prevent it from running on initial page load. Alternatively, implement checks within your callback function for `None` or initial states of inputs.
affects: All
gotchaWith the introduction of multi-backend support in Dash 4.1.0, there are two distinct ways to specify a backend server: `Dash(backend="flask"| "fastapi" | "quart")` or `Dash(server=existing_server_instance)`. Using `backend` creates a new server instance, while `server` attaches Dash to an *already existing* Flask/FastAPI/Quart application instance.
fix
Choose the correct parameter based on your needs. Use `backend` if you want Dash to manage the server instance (e.g., `app = Dash(__name__, backend='fastapi')`). Use `server` if integrating Dash into an existing, running web framework application (e.g., `app = Dash(server=my_fastapi_app)`).
affects: >=4.1.0
breakingThe `app.run_server()` method has been deprecated and subsequently removed. It has been replaced by `app.run()`.
fix
Change any calls to `app.run_server(...)` to `app.run(...)`.
affects: >=2.0.0
breakingThe `app.run_server()` method for running a Dash application has been removed and replaced by `app.run()` starting from Dash v4.0.0. Calling `app.run_server()` will raise an `ObsoleteAttributeException`.
fix
Replace `app.run_server(...)` with `app.run(...)` in your Dash application code.
affects: >=4.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dash'
The Dash library or its essential components are not installed in the active Python environment, or the environment is not correctly activated.
fix
Run `pip install dash` in your terminal to install the Dash library and its core components.
ImportError: cannot import name 'dcc' from 'dash'
This error often occurs due to version discrepancies (older Dash versions required separate imports for `dash_core_components` and `dash_html_components`) or a circular import if a local file is named `dash.py`.
fix
For Dash 2.0 and newer, ensure imports are `from dash import dcc, html`. For older versions (pre-2.0), use `import dash_core_components as dcc` and `import dash_html_components as html`. Also, rename any local file named `dash.py`.
AttributeError: 'Dash' object has no attribute 'run'
The method `app.run()` is not the correct way to start a Dash application; the correct method is `app.run_server()`.
fix
Change `app.run()` to `app.run_server()` to properly launch your Dash application.
AttributeError: module 'dash' has no attribute 'Dash'
A local Python file named `dash.py` exists in your project or current working directory, which Python attempts to import instead of the actual Dash library, leading to a naming conflict.
fix
Rename any file named `dash.py` (e.g., to `app.py` or `my_dash_app.py`) to avoid conflicting with the installed `dash` package.
Error loading layout
This is a generic client-side error indicating that the `app.layout` structure is malformed, contains invalid components, or has incorrect property assignments, which prevents Dash from rendering the page.
fix
Enable debug mode (`app.run_server(debug=True)`) to get detailed server-side tracebacks and carefully inspect your `app.layout` definition for syntax errors, invalid component properties, or improper nesting.
Upgrade
Version history
4.4.1latest on PyPI · released Jul 21, 2026
Audit
Dependencies
flaskrequiredDefault web server backend for Dash applications.
fastapioptionalAlternative web server backend (requires `dash[fastapi]` install).
quartoptionalAlternative web server backend (requires `dash[quart]` install).
Agent activity
58 hits · last 30 days
node
54
OpenAI (training)
1
Resources
dash — pip install dash · libregistry