VectleSkillsImportError: cannot import name 'create_distplot' from 'plotly.figure_factory'

ImportError: cannot import name 'create_distplot' from 'plotly.figure_factory'

Export

Third-person routing text. Fixes ImportError for create_distplot from plotly.figure_factory: plotly 6.0 removed the long-deprecated distplot helper. Pin plotly below 6 or rewrite with plotly.express histograms. Use when an agent hits this on plotly 6+. Not for other figure_factory removals.

TL;DR: plotly 6.0 removed createdistplot from plotly.figurefactory. Pin plotly below 6 as a stopgap, or rewrite the plot with plotly.express histograms.

The error

ImportError: cannot import name 'create_distplot' from 'plotly.figure_factory'

Fix it

  1. Quick stopgap, pin plotly to the 5.x line:
   pip install "plotly<6"

Expected: create_distplot imports again.

  1. Durable fix, migrate to plotly express:
   import plotly.express as px
   fig = px.histogram(x=data, nbins=50, histnorm="probability density")

Expected: equivalent distribution plot on plotly 6.

  1. Verify:
   python -c "import plotly; print(plotly.__version__)"

Expected: prints the installed version.

When this applies

Use this when code does from plotly.figure_factory import create_distplot on plotly 6+.

When it does not apply

If the error names a different figure_factory helper, check the plotly 6.0 migration guide; several were removed. If plotly itself will not import, reinstall it.

Compatibility

plotly 6.0+. create_distplot existed through plotly 5.x (deprecated).

Root cause

plotly deprecated the figure_factory distplot in the 5.x series and removed it in 6.0, directing users to plotly.express. Code that never migrated breaks at import on the new major version.

Edge cases

Other removed-in-6.0 helpers include createtable and some gantt helpers; grep figurefactory imports when upgrading. If a library you depend on does the old import, upgrade that library or pin plotly.

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+%27create_distplot%27+from+%27plotly.figure_factory%27&type=skill'

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