{"id":8249,"library":"jupyter-bokeh","title":"Jupyter Bokeh","description":"Jupyter Bokeh is a Jupyter extension that enables Bokeh plots to render interactively within Jupyter notebooks and JupyterLab environments. It acts as a bridge, ensuring that Bokeh's rich interactive visualizations work seamlessly. The current version is 4.0.5, and it follows Bokeh's release cadence, typically updating to support new Bokeh features and Jupyter environments.","status":"active","version":"4.0.5","language":"en","source_language":"en","source_url":"https://github.com/bokeh/jupyter_bokeh.git","tags":["jupyter","bokeh","visualization","interactive","plotting"],"install":[{"cmd":"pip install jupyter-bokeh","lang":"bash","label":"Basic Installation"},{"cmd":"jupyter nbextension enable --py --sys-prefix jupyter_bokeh\njupyter labextension install @jupyter-widgets/jupyterlab-manager","lang":"bash","label":"Enable for Notebook/Lab (Optional but Recommended)"}],"dependencies":[{"reason":"Required for creating Bokeh plots that jupyter-bokeh renders.","package":"bokeh","optional":false},{"reason":"Crucial for interactive widgets and communication in Jupyter.","package":"ipywidgets","optional":false},{"reason":"Required for classic Jupyter Notebook integration.","package":"notebook","optional":false},{"reason":"Used for some advanced dashboarding features, though not strictly required for basic rendering.","package":"panel","optional":true}],"imports":[{"note":"While Jupyter Bokeh largely works automatically, this import refers to the underlying widget. It's rarely directly used by end-users for plot rendering, but can be useful for debugging or advanced programmatic control.","symbol":"JupyterBokeh","correct":"from jupyter_bokeh.widget import JupyterBokeh"}],"quickstart":{"code":"from bokeh.plotting import figure, show\n\n# Create a new plot with a title and axis labels\np = figure(title=\"My First Bokeh Plot\", x_axis_label='x', y_axis_label='y')\n\n# Add a circle renderer with size, color, and alpha\np.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=10, color=\"navy\", alpha=0.5)\n\n# Show the results in the notebook\nshow(p)","lang":"python","description":"After installing `jupyter-bokeh`, Bokeh plots automatically render interactively in Jupyter environments. Simply create a Bokeh plot using `bokeh.plotting` and call `show()`."},"warnings":[{"fix":"Ensure the Jupyter extension is enabled: `jupyter nbextension enable --py --sys-prefix jupyter_bokeh` for Notebook or `jupyter labextension install @jupyter-widgets/jupyterlab-manager` for JupyterLab. Restart your Jupyter server afterwards.","message":"Jupyter extension not properly enabled after installation may prevent plots from rendering or interacting correctly.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always check the `jupyter-bokeh` documentation/PyPI page for compatible `bokeh` and `ipywidgets` versions. Upgrade both `jupyter-bokeh` and its dependencies (`pip install --upgrade jupyter-bokeh bokeh ipywidgets`) to ensure compatibility.","message":"Incompatible `bokeh` or `ipywidgets` versions can lead to rendering issues or broken interactivity.","severity":"breaking","affected_versions":"All versions"},{"fix":"Check your browser's developer console for JavaScript errors. Ensure no ad-blockers or browser extensions are interfering with content delivery network (CDN) requests. Try clearing your browser cache or using a different browser. Verify the Jupyter extension is enabled.","message":"Plots might appear as static images or not at all if the JavaScript frontend assets fail to load or are blocked.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure that your `Bokeh` callbacks are correctly set up, especially if they involve `CustomJS` or `ColumnDataSource`. For complex interactive applications within Jupyter, consider using `Panel` with Bokeh which offers more robust server-side callback mechanisms.","message":"Plots not updating or interacting correctly when using complex Bokeh layouts or callbacks in Jupyter.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Right-click on the output cell in JupyterLab and select 'Enable Javascript/HTML Output' or check your JupyterLab settings for default output behavior.","cause":"The JupyterLab output area is configured to not execute JavaScript, often for security reasons or by default for specific output types.","error":"JavaScript output is disabled in JupyterLab"},{"fix":"Run `jupyter nbextension enable --py --sys-prefix jupyter_bokeh` and restart your Jupyter Notebook server.","cause":"The `jupyter-bokeh` Jupyter Notebook extension was not properly enabled or is not accessible.","error":"Error loading script: http://localhost:8888/nbextensions/jupyter_bokeh/index.js"},{"fix":"Install Bokeh: `pip install bokeh`.","cause":"`bokeh` is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'bokeh'"},{"fix":"Ensure `jupyter-bokeh` is installed and enabled: `pip install jupyter-bokeh` then `jupyter nbextension enable --py --sys-prefix jupyter_bokeh` (for Notebook) or `jupyter labextension install @jupyter-widgets/jupyterlab-manager` (for Lab). Restart Jupyter after enabling.","cause":"`jupyter-bokeh` is installed but the corresponding Jupyter extension is not enabled, or the `bokeh` notebook extension is not properly configured.","error":"Bokeh: ERROR: Unable to display Bokeh plots in the Jupyter notebook. When showing a plot, make sure the corresponding notebook extension is loaded. Refer to the 'set up' section on the Bokeh user guide for more information."}]}