Skip to content

Conversation

wildfluss
Copy link

No description provided.

@lr222gw
Copy link

lr222gw commented Apr 24, 2025

Tried it, fixed my issue.

Code below gave me the following error prior to the fix: ImportError: cannot import name 'display' from 'IPython.core.display'

import spacy
from spacy import displacy

nlp = spacy.load("en_core_web_sm")
text = "This is a dummy text for testing purposes"
doc = nlp(text) 
displacy.render(doc, style="dep", jupyter=True)

The changed line from IPython.core.display import display, HTML was originally committed 2017: a045506

IPython deprecated display in 2020:
ipython/ipython@43a01a2

@ines ines added the feat / visualizers Feature: Built-in displaCy and other visualizers label May 12, 2025
@ines
Copy link
Member

ines commented May 12, 2025

Thanks a lot! I will close this in favor of the duplicate #13787, which has more details in the PR description and merge the two 😊

@ines ines closed this May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat / visualizers Feature: Built-in displaCy and other visualizers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants