Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Update display import for compatibility with latest IPython Fixes: #13763 #13787

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rnihesh
Copy link

@rnihesh rnihesh commented Apr 4, 2025

Fix: Update display import for compatibility with latest IPython


Description

This PR updates the import statement in displacy.render() to fix an ImportError caused by breaking changes in IPython 9+.

Replaced:

from IPython.core.display import HTML, display

With:

from IPython.display import HTML, display

The display function is no longer available in IPython.core.display in IPython 9 and above. This change ensures displacy.render() works correctly in Jupyter and notebook environments using newer versions of IPython.

Tested in:

  • Python 3.12.9 (venv)
  • IPython 9.0.2
  • JupyterLab
  • Confirmed displacy.render() now works without error.

Types of change

  • Bug fix

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

Fixes: #13763

@rnihesh rnihesh changed the title Fix: Update display import for compatibility with latest IPython Fix: Update display import for compatibility with latest IPython Fix: 13763 Apr 4, 2025
@rnihesh rnihesh changed the title Fix: Update display import for compatibility with latest IPython Fix: 13763 Fix: Update display import for compatibility with latest IPython Fixes: #13763 Apr 4, 2025
@majorgilles
Copy link

also ran into this issue, was about to submit my own PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"from IPython.core.display import HTML, display" no more supported for latest IPython
2 participants