This section provides complete details about Bokeh’s required and optional dependencies as well as information about how to install Bokeh in different situations. To get up and running as fast as possible, see the Installation section of the Quickstart.
Bokeh is officially supported (and continuously tested) on CPython versions 3.6+ only. Other Python versions or implementations may function, possibly limited capacity, but no guarantees or support is provided.
For basic usage, have the following libraries installed:
PyYAML>=3.10 python-dateutil>=2.1 Jinja2>=2.7 numpy>=1.11.3 pillow>=4.0 packaging>=16.8 tornado>=5 typing_extensions >=3.7.4
In addition to the required dependencies above, 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 Using with Jupyter for full details.
Necessary for Extending Bokeh or for defining
CustomJSimplementations in TypeScript.
Necessary to use the
from_networkxfunction to generate Bokeh graph renderers directly from NetworkX data.
Necessary for the
hexbinfunction. Additionally, some usage is simplified by using Pandas e.g. Pandas DataFrames will be converted automatically to Bokeh data sources by glyph functions.
Necessary to enable detailed memory logging in the Bokeh server.
- Selenium, GeckoDriver, Firefox
Necessary for Exporting Plots to PNG and SVG images.
Necessary to make use of the
bokeh.sphinxextSphinx extension for including Bokeh plots in Sphinx documentation.
These Bokeh dependencies are best obtained via the Anaconda Python Distribution, which was designed to include robust versions of popular libraries for the Python scientific and data analysis stacks.
If you are already an Anaconda user, you can simply run the command:
conda install bokeh
This will install the most recent published Bokeh release from the Anaconda, Inc. package repository, along with all dependencies.
Alternatively, it is possible to install from PyPI using
pip install bokeh
Some of the Bokeh examples rely on sample data that is not included in the Bokeh GitHub repository or released packages, due to their size. Once Bokeh is installed, the sample data can be obtained by executing the following command at a Bash or Windows prompt:
Alternatively, the following statements can be executed in a Python interpreter:
>>> import bokeh.sampledata >>> bokeh.sampledata.download()
Finally, the location that the sample data is stored can be configured. See the bokeh.sampledata reference for details.
In addition to the standard installation methods above, Bokeh can also be installed in some specialized ways for advanced usage or development.
Installing Bokeh from source requires rebuilding the BokehJS library from its TypeScript sources. Some additional toolchain support is required. Please consult the Getting Set Up section of the Developers for detailed instructions.
versions of BokehJS are available for download from CDN at
under the following naming scheme:
"-widgets" files are only necessary if you are using any of the widgets
built into Bokeh in
bokeh.models.widgets in your documents. Similarly, the
"-tables" files are only necessary if you are using Bokeh data tables in
your document. The
"bokeh-api" files are required to use the BokehJS API,
and must be loaded after the core BokehJS library.
As a concrete example, the links for version
You should always set crossorigin=”anonymous” on script tags that load BokehJS from CDN.