ImportError: cannot import name 'display' from 'IPython.core.display'
Third-person routing text. Fixes ImportError for display from IPython.core.display: newer IPython moved it to IPython.display. Import from IPython.display instead, or upgrade spacy. Use when an agent hits this in spacy displacy or similar code. Not for other IPython moves.
TL;DR: IPython moved display from IPython.core.display to IPython.display. Change the import, or upgrade spacy to a release that did.
The error
ImportError: cannot import name 'display' from 'IPython.core.display'Fix it
- Replace the import:
from IPython.display import displayExpected: no import error.
- If the bad import is inside spacy's displacy, upgrade spacy instead:
pip install -U spacyExpected: new release uses the new path.
- Verify:
python -c "from IPython.display import display; print('ok')"Expected: prints ok.
When this applies
Use this when code does from IPython.core.display import display on modern IPython.
When it does not apply
If the error names a different IPython.core member, look up its new location. If IPython itself will not import, reinstall it.
Compatibility
Modern IPython (7+). IPython.display has re-exported display for years, so the new import works broadly.
Root cause
IPython reorganized its display machinery and made IPython.display the public namespace; the old IPython.core.display path stopped exporting every name. Code importing from the old path breaks.
Edge cases
HTML, Markdown, and SVG moved the same way; update all IPython.core.display imports in one pass. Libraries should import from IPython.display unconditionally now.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.