plotly

How to Install Plotly Dash

Plotly Dash, commonly known as Dash, is a free and open-source Python Framework that allows you to create highly customizable plots with a web browser. Dash is built on top of Flash and Plotly.js providing you with fast and powerful features to create interactive plots within your browser.

Plotly removes the need to learn front-web development stacks to create analytical dashboards. Hence, you can focus on analyzing and plotting your data and not solving how to place your plot inside a Div.

This tutorial will teach you how to set up Plotly Dash on your Linux environment.

Installing Python and Pip

Before installing Dash, you need to have Python running on your system. For maximum compatibility, we recommend having Python3 installed.

You can verify the running Python version using the command:

$ python3 -–version

The command above should return the output as shown:

We can confirm that Python3 is installed on your system.

If you do not have Python 3.x installed, you can run the commands as shown to install it.

On Debian and Debian-based distributions:

$ sudo apt-get install python3 python3-pip -y

The command above should install the Python3 interpreter and the pip package manager.

On Arch:

$ sudo pacman -S python python-pip

On CentOS and REHL:

$ sudo yum install python3 python3-pip

On OpenSUSE:

$ sudo zypper install python3 python3-pip

Once you have successfully installed Python3 and Pip, we can proceed to install Dash.

Step 2: Install Plotly Dash

To install Plotly Dash, use pip as follows:

$ pip3 install dash

The command above should download and install Dash, plotly, and other required packages.

You can confirm that you have Dash installed by running the command:

>>> import dash
>>> dash.__version__
'2.5.1'

The above should return the installed dash version as shown in the output.

Step 3: Installing Dash for Jupyter Notebook

If you are using Jupyter Notebook or Jupyter Lab as your development environment, you need to install the Dash version for Jupyter.

You can use pip as follows:

$ pip3 install jupyter-dash

The command above should install jupyter-dash and all the required components. Depending on the packages to install, this can take a few minutes.

You can verify Dash for Jupyter is installed:

$ python3 -m pip show jupyter-dash

This should return output as shown:

Conclusion

In this tutorial, you learned how to install Plotly Dash on your Linux machine.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list