This section provides more detailed information about installing Bokeh. This includes details about Bokeh’s prerequisites as well as Bokeh’s required and optional dependencies.
Bokeh is officially supported (and continuously tested) on CPython versions 3.9 and later. It’s possible that Bokeh does work on other versions of Python, but no guarantees or support are provided.
Bokeh can be installed using either the Python package installer
conda, the package manager for the Anaconda Python Distribution.
Use this command to install Bokeh:
pip install bokeh
conda install bokeh
Alternatively, if you want to make sure you always have the most recent version of Bokeh after each new release, install from the Bokeh channel directly:
conda install -c bokeh bokeh
Checking your installation#
To verify whether the installation was successful, use this command:
You should see, among other things, a line with information on the installed version of Bokeh.
Installing for development#
Installing required dependencies#
For basic usage, Bokeh requires the following libraries:
- Jinja2 >=2.9
- contourpy >=1
- numpy >=1.16
- packaging >=16.8
- pandas >=1.2
- pillow >=7.1.0
- PyYAML >=3.10
- tornado >=5.1
- xyzservices >=2021.09.1
All those packages are automatically installed if you use
Installing optional dependencies#
In addition to the required dependencies, some additional packages are necessary for certain optional features:
Bokeh can display content in classic Jupyter notebooks as well as in JupyterLab. Depending on your setup, there may be additional packages or Jupyter extensions to install. See Jupyter for full details.
Necessary for Custom extensions or for defining
CustomJSimplementations in TypeScript.
Necessary to use the
from_networkx()function to generate Bokeh graph renderers directly from NetworkX data.
Necessary to enable detailed memory logging in the Bokeh server.
- Selenium, GeckoDriver, Firefox
Necessary for PNG and SVG export to PNG and SVG images.
Necessary to make use of the
bokeh.sphinxextSphinx extension for including Bokeh plots in Sphinx documentation.
Installing sample data#
Optionally, Bokeh can download and install a collection of sample data. This includes a variety of freely available data tables and databases that you can use with Bokeh. Because this sample data is rather large, it is not included in Bokeh’s installation packages.
After installing Bokeh, you can automatically download and install the sample data with this command:
Alternatively, you can download and install the sample data from within your Python code:
import bokeh.sampledata bokeh.sampledata.download()
If you want to change the location where Bokeh stores the sample data, check the bokeh.sampledata reference for details.
Installing standalone BokehJS#
BokehJS is Bokeh’s client-side runtime library. You can also use BokehJS as a
delivery network (CDN) at
cdn.bokeh.org. The CDN uses the following naming
Only the Bokeh core library
bokeh-x.y.z.min.js is always required. The
other scripts are optional and only need to be included if you want to use
"bokeh-widgets"files are only necessary if you are using any of the Bokeh widgets.
"bokeh-tables"files are only necessary if you are using Bokeh’s data tables.
"bokeh-api"files are required to use the BokehJS API and must be loaded after the core BokehJS library.
"bokeh-gl"files are required to enable WebGL support.
"bokeh-mathjax"files are required to enable MathJax support.
x.y.z with the Bokeh version you want to use. For example, the links
You should always set
crossorigin="anonymous" on script tags that load
BokehJS from CDN.