mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-07 21:33:13 +03:00
displacy: fix import path for ipython 9.0.1
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
This commit is contained in:
parent
b3c46c315e
commit
04703d0d06
|
@ -66,7 +66,12 @@ def render(
|
||||||
if jupyter or (jupyter is None and is_in_jupyter()):
|
if jupyter or (jupyter is None and is_in_jupyter()):
|
||||||
# return HTML rendered by IPython display()
|
# return HTML rendered by IPython display()
|
||||||
# See #4840 for details on span wrapper to disable mathjax
|
# See #4840 for details on span wrapper to disable mathjax
|
||||||
from IPython.core.display import HTML, display
|
try:
|
||||||
|
# import path was changed in IPython 8.0.0 43a01a21101ea65dbd52cf760c1e4f149bfab588
|
||||||
|
# and the path shim was finally removed in 9.0.1 8a0533f31abcc4cb4341858bdeee86e2061c4fd9
|
||||||
|
from IPython.display import HTML, display
|
||||||
|
except ImportError:
|
||||||
|
from IPython.core.display import HTML, display
|
||||||
|
|
||||||
return display(HTML('<span class="tex2jax_ignore">{}</span>'.format(html)))
|
return display(HTML('<span class="tex2jax_ignore">{}</span>'.format(html)))
|
||||||
return html
|
return html
|
||||||
|
|
Loading…
Reference in New Issue
Block a user