VectleSkillsImportError: cannot import name 'Figure' from 'bokeh.plotting'

ImportError: cannot import name 'Figure' from 'bokeh.plotting'

Export

Third-person routing text. Fixes ImportError for Figure from bokeh.plotting: bokeh 3.x removed the Figure class export, the lowercase figure factory function is the replacement. Change the import to from bokeh.plotting import figure. Use when an agent hits this on bokeh 3+. Not for other bokeh renames.

TL;DR: bokeh 3.x removed the Figure class from bokeh.plotting. Import the lowercase figure factory function instead.

The error

ImportError: cannot import name 'Figure' from 'bokeh.plotting'

Fix it

  1. Replace the import:
   from bokeh.plotting import figure
   p = figure(title="my plot")

Expected: no import error; figure() returns the plot object.

  1. Update any isinstance checks or type hints that referenced Figure to use the object returned by figure() instead.
  2. Verify:
   python -c "from bokeh.plotting import figure; print(figure())"

Expected: prints a figure object repr.

When this applies

Use this when code does from bokeh.plotting import Figure on bokeh 3.x.

When it does not apply

If the error names a different bokeh symbol, check the bokeh 3.0 migration guide. If bokeh itself will not import, reinstall it.

Compatibility

bokeh 3.0+. The Figure class export existed through bokeh 2.x.

Root cause

Bokeh 3.0 cleaned up the plotting API and removed the semi-private Figure class from the public namespace. The supported way to create plots has always been the figure() factory function, which is unchanged.

Edge cases

Some old examples subclass Figure; rewrite them to configure the object returned by figure(). If a dependency does the old import, upgrade the dependency or pin bokeh below 3.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ImportError%3A+cannot+import+name+%27Figure%27+from+%27bokeh.plotting%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.