Dash Installation Guide
Dash is an open-source Python-based framework for building interactive web applications, suitable for data analysis and visualization, because it allows developers to create complex user interfaces through simple Python code.
Dash's core components include dash, dash-core-components, dash-html-components and dash-bootstrap-components, which together form a powerful toolkit that helps developers quickly build data-driven web applications.
Dash is a Python-based framework, so the installation process is very simple, mainly completed via pip.
Prerequisites for Installing Dash
Before installing Dash, you need to ensure that Python is installed on your system. Dash supports Python 3.6 and above. If you have not installed Python, you can download and install the version suitable for your operating system from Python official website .
You can also refer to our Python Tutorial.
Install Dash
Installing Dash is very simple and can be done through Python's package management tool pip .
pip is Python's package management tool, used to install Dash and its dependencies.
To ensure pip is installed, you can check with the following command:
pip --version
Note: Python 2.7.9+ or Python 3.4+ and above all include the pip tool.
If it is not installed, see:Python pip Installation and Usage.
Open a terminal or command-line tool and run the following command:
pip install dash
或
pip3 install dash
This command installs Dash's core library and its dependencies, including:
-
dash: Dash's core library. -
dash-core-components: Dash's core components library (such as input boxes, dropdown menus, charts, etc.). -
dash-html-components: Dash's HTML components library (such asdiv,h1,petc.). -
dash-table: a component for displaying and manipulating tabular data.
In addition to the core libraries, Dash also supports some optional dependency libraries to enhance functionality.
The following are common optional libraries and their installation methods:
1. Plotly
Plotly is Dash's default chart rendering library. If you need to use Plotly to create charts, you can install it separately:
pip install plotly
2. Pandas
Pandas is a powerful data processing library, often used in combination with Dash. Installation command:
pip install pandas
3. JupyterDash
If you wish to use Dash in Jupyter Notebook, you can install jupyter-dash:
pip install jupyter-dash
4. Dash Bootstrap Components
Dash Bootstrap Components provides Bootstrap-style components for quickly building beautiful layouts. Installation command:
pip install dash-bootstrap-components
Verify the installation
After installation, you can verify whether Dash was installed successfully with the following command:
Example
python
-c
"import dash; print(dash.version)"
or
python3
-c
"import dash; print(dash.version)"
If the installation is successful, you will see the Dash version number output, for example:
3.2.0
In addition, you can use the following command to view detailed installation information about Dash:
python -m pip show dash
This command displays Dash's version number, installation location, and dependency information.
Note: Dash 3.0 and above have replaced app.run_server() with app.run(). When using the new version of Dash, the new startup method should be adopted.