compatibility: is prodigy 1.8.x compatible with spacy 2.1.0?

Hello,
is prodigy 1.8.x compatible with spacy 2.1.0?
I get error using these two packages together:

from prodigy.models.matcher import PatternMatcher
  File "/usr/local/lib/python3.6/site-packages/prodigy/__init__.py", line 10, in <module>
    from . import recipes  # noqa
  File "/usr/local/lib/python3.6/site-packages/prodigy/recipes/__init__.py", line 4, in <module>
    from . import dep, ner, textcat, pos, compare, terms, generic, image, review  # noqa
  File "/usr/local/lib/python3.6/site-packages/prodigy/recipes/textcat.py", line 11, in <module>
    from ..models.textcat import TextClassifier
  File "cython_src/prodigy/models/textcat.pyx", line 10, in init prodigy.models.textcat
ImportError: cannot import name Sentencizer

thanks,
Ati

Yes, Prodigy v1.8.x includes updates for compatibility with spaCy v2.1.x. You can find more details in the changelog: https://prodi.gy/docs/changelog

Are you sure you’re running the correct versions and both spaCy and Prodigy are installed correctly? Did you start with a fresh virtual environment? From the error message, it looks like you’re still running an older version of spaCy < 2.1.

Thanks Ines for your reply.
I installed spacy and then prodigy in a docker.
SpaCy 2.1.0, 2.1.1, and 2.1.2 did not work. SpaCy 2.1.3 and 2.1.4 are working so I upgraded to 2.1.4.

Ah yes, each Prodigy wheel will define the spaCy version it’s compatible with in its dependencies, and it’ll be installed when you install the wheel. So you usually want to let Prodigy handle its dependencies – if you install other version on top of it, you might end up with incompatibilities (and pip won’t tell you, because it doesn’t resolve the dependencies recursively, like conda etc.).

1 Like