spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

displacy: fix import path for ipython 9.0.1

Open 1480c1 opened this issue 10 months ago • 1 comments

Description

With IPython 9.0.1, they removed the IPython.core.display shim that displacy.render() relied on. This was apparently deprecated in IPython 8.0.0.

This fixes it by trying the newer import path if possible, falling back to the older one.

Types of change

Bug fix

Checklist

  • [x] I confirm that I have the right to submit this contribution under the project's MIT license.
  • [ ] I ran the tests, and all new and existing tests passed.
  • [x] My changes don't require a change to the documentation, or if they do, I've added all required information.

I am unable to install the packages in requirements.txt due to thinc<8.4.0,>=8.3.4 being unsatisfied since there's only nearby version 8 package is 8.3.2 and then it skips to 9.0.0.dev0. However, editing this line locally fixed the import issue.

1480c1 avatar Mar 04 '25 07:03 1480c1

You may close this PR since the same fix #13787 is progressing.

otakutyrant avatar May 16 '25 22:05 otakutyrant