Installing and Importing Bokeh in Python

Greetings! Some links on this site are affiliate links. That means that, if you choose to make a purchase, The Click Reader may earn a small commission at no extra cost to you. We greatly appreciate your support!

Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics, and affords high-performance interactivity over large or streaming datasets.

Bokeh

We will start by installing and importing the library in Python.


Installing Bokeh in Python using pip

Bokeh can be installed using python package manager pip as follows:

pip install bokeh 

Importing Bokeh in Python

Starting from this section onwards, we will be using Jupyter Notebooks as our Python IDE.

To import Bokeh in Python, write the following code and run it:

# Libraries/Modules import conventions
from bokeh.io import output_notebook, show
from bokeh.plotting import figure, output_file, show

Import sample data for bokeh

import bokeh.sampledata
# To download sample data for visualization
 bokeh.sampledata.download()

Check Bokeh version in Python

To check the version of the installed Bokeh library, write the following code and run it:

# Check version of bokeh installed
print(bokeh.__version__)  # version:1.4.0

This is it for the basic installation of Bokeh in Python. You are now ready to start plotting your own plots in Python.

Leave a Comment