"from IPython.core.display import HTML, display" no more supported for latest IPython
Please consider replace from IPython.core.display import HTML, display by from IPython.display import HTML, display.
I've Fixed the issue and replaced it.
But there's more behind it. The import from display is only successful when it's realized as a function; display() that inherits the variable that contains the displacy.render-method:
from IPython.display import display, HTML from spacy import displacy import spacy nlp = spacy.load("en_core_web_sm") doc = nlp("This is a test sentence for displaCy visualization.")
sent_exp = displacy.render(doc, style='dep', jupyter=False, options={'distance': 80}) from IPython.display import display, HTML display(HTML(sent_exp))
Else, by just rendering via Displacy without running via display(), the import is conflicting internally with IPython by always trying to import from IPython.core.display.
Yeah true, that was fixed in the other PR waiting for it to be accepted and merged. PR
Hello this issue is fixed by PR https://github.com/explosion/spaCy/pull/13865 (merged)