plotly

How to Install Plotly for Python 3 Jupyter Notebook

Plotly is a free and open-source plotting library for Python, JavaScript, R, and other languages. It supports a wide range of use cases including geographical plotting, financial analysis, scientific plots, and etc.

Plotly is also cross-platform. This means you can install and use Plotly on any system that has a supported Python interpreter.

In this tutorial, we will show you how to setup Plotly with Jupyter Notebook or Jupyter environment support.

Let’s get started.

Installing Jupyter Notebook

Before installing Plotly and its dependencies, it is good to ensure you have Jupyter Notebook installed on your system.

Luckily, Jupyter Notebook and its equivalent environments can be installed from the Python Package Index.

The commands are as shown:

Install Jupyter Notebook with pip

$ pip install notebook

$ pip3 install notebook

To install Jupyter Lab, run the command as:

$ pip install jupyterlab

$ pip3 install jupyterlab

Once installed, you can run Jupyter Notebook or Jupyter Lab with the commands shown:

$ jupyter notebook

$ jupyter-lab

Installing Plotly with Jupyter Notebook Support

Once you have Jupyter Notebook installed, we can proceed installing the Plotly package with Jupyter Notebook support.

Run the command below to install the Plotly with Notebook support:

$ pip install plotly plotly-orca ipywidgets pandas

$ pip3 install plotly plotly-orca ipywidgets pandas

If you are using anaconda, you can install by running the command:

$ conda install plotly plotly-orca ipywidgets pandas

Once installed, you can open Jupyter Notebook and start creating your Plots. Keep in mind that Plotly will choose the renderer based on the target environment.

Closing

In this tutorial, we covered how to install Plotly with support for Jupyter Notebook.

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