Installing and Importing Bokeh in Python

Table of Contents
Primary Item (H2)

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.

Written by
The Click Reader
At The Click Reader, we are committed to empowering individuals with the tools and knowledge needed to excel in the ever-evolving field of data science. Our sole focus is delivering a world-class data science bootcamp that transforms beginners and upskillers into industry-ready professionals.

Interested In Data Science Bootcamp?
Request more info now.

Lead Collection Form
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram