Skip to content

vscode doesn't like displacy.render(sentence1, style="dep") #13809

@kundeng

Description

@kundeng

How to reproduce the behaviour


ImportError                               Traceback (most recent call last)
Cell In[44], line 2
      1 from spacy import displacy
----> 2 displacy.render(sentence1, style="dep")

File c:\Users\kundeng\scoop\persist\mambaforge\envs\spacy\Lib\site-packages\spacy\displacy\__init__.py:69, in render(docs, style, page, minify, jupyter, options, manual)
     65     html = RENDER_WRAPPER(html)
     66 if jupyter or (jupyter is None and is_in_jupyter()):
     67     # return HTML rendered by IPython display()
     68     # See #4840 for details on span wrapper to disable mathjax
---> 69     from IPython.core.display import HTML, display
     71     return display(HTML('<span class="tex2jax_ignore">{}</span>'.format(html)))
     72 return html

ImportError: cannot import name 'display' from 'IPython.core.display' (c:\Users\xxx\scoop\persist\mambaforge\envs\spacy\Lib\site-packages\IPython\core\display.py)

Your Environment

  • Operating System: Windows 11
  • Python Version Used: python 3.12.10
  • spaCy Version Used: 3.8.5
  • Environment Information: Conda Mamaforge

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions