diff --git a/spacy/displacy/__init__.py b/spacy/displacy/__init__.py index 032c27ce7..f7466bbb8 100644 --- a/spacy/displacy/__init__.py +++ b/spacy/displacy/__init__.py @@ -66,7 +66,10 @@ def render( if jupyter or (jupyter is None and is_in_jupyter()): # return HTML rendered by IPython display() # See #4840 for details on span wrapper to disable mathjax - from IPython.display import HTML, display + try: + from IPython.display import HTML, display + except ImportError: + from IPython.core.display import HTML, display return display(HTML('{}'.format(html))) return html