ImportError: cannot import name cleanup_beam

Traceback (most recent call last):
File "/opt/tljh/user/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/opt/tljh/user/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/opt/tljh/user/lib/python3.7/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/opt/tljh/user/lib/python3.7/site-packages/prodigy/init.py", line 7, in
from . import recipes
File "/opt/tljh/user/lib/python3.7/site-packages/prodigy/recipes/init.py", line 4, in
from ..deprecated import recipes # noqa
File "/opt/tljh/user/lib/python3.7/site-packages/prodigy/deprecated/recipes.py", line 15, in
from ..models.matcher import PatternMatcher
File "/opt/tljh/user/lib/python3.7/site-packages/prodigy/models/init.py", line 1, in
from .ner import EntityRecognizer, merge_spans # noqa: F401
File "cython_src/prodigy/models/ner.pyx", line 11, in init prodigy.models.ner
ImportError: cannot import name cleanup_beam

I have checked the issue with fixing spacy version!!. but no luck

My pip list is as below:

Package Version


aiofiles 0.8.0
argcomplete 2.0.0
backcall 0.2.0
blis 0.7.5
cachetools 5.0.0
catalogue 2.0.6
certifi 2021.10.8
charset-normalizer 2.0.10
click 7.1.2
cymem 2.0.6
debugpy 1.5.1
decorator 5.1.1
entrypoints 0.3
fastapi 0.68.2
h11 0.12.0
idna 3.3
importlib-metadata 4.10.0
ipykernel 6.6.1
ipython 7.31.0
jedi 0.18.1
Jinja2 3.0.3
jupyter-client 7.1.0
jupyter-core 4.9.1
langcodes 3.3.0
MarkupSafe 2.0.1
matplotlib-inline 0.1.3
murmurhash 1.0.6
nest-asyncio 1.5.4
numpy 1.21.5
packaging 21.3
parso 0.8.3
pathy 0.6.1
peewee 3.14.8
pexpect 4.8.0
pickleshare 0.7.5
pip 19.0.3
plac 1.1.3
preshed 3.0.6
prodigy 1.11.7
prompt-toolkit 3.0.24
ptyprocess 0.7.0
pydantic 1.8.2
Pygments 2.11.2
PyJWT 2.3.0
pyparsing 3.0.6
python-dateutil 2.8.2
pyzmq 22.3.0
requests 2.27.1
setuptools 40.8.0
six 1.16.0
smart-open 5.2.1
spacy 3.2.1
spacy-legacy 3.0.8
spacy-loggers 1.0.1
srsly 2.4.2
starlette 0.14.2
thinc 8.0.13
toolz 0.11.2
tornado 6.1
tqdm 4.62.3
traitlets 5.1.1
typer 0.3.2
typing-extensions 3.10.0.2
urllib3 1.26.8
uvicorn 0.13.4
wasabi 0.9.0
wcwidth 0.2.5
zipp 3.7.0

I have the same issue i updated the spacy version.
My error is as below :slight_smile:
Traceback (most recent call last):
File "/opt/tljh/user/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/opt/tljh/user/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/opt/tljh/user/lib/python3.7/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/opt/tljh/user/lib/python3.7/site-packages/prodigy/init.py", line 7, in
from . import recipes
File "/opt/tljh/user/lib/python3.7/site-packages/prodigy/recipes/init.py", line 4, in
from ..deprecated import recipes # noqa
File "/opt/tljh/user/lib/python3.7/site-packages/prodigy/deprecated/recipes.py", line 15, in
from ..models.matcher import PatternMatcher
File "/opt/tljh/user/lib/python3.7/site-packages/prodigy/models/init.py", line 1, in
from .ner import EntityRecognizer, merge_spans # noqa: F401
File "cython_src/prodigy/models/ner.pyx", line 11, in init prodigy.models.ner
ImportError: cannot import name cleanup_beam

my pip list is as below. I tried different version of spcay but no luck


aiofiles 0.8.0
argcomplete 2.0.0
backcall 0.2.0
blis 0.7.5
cachetools 5.0.0
catalogue 2.0.6
certifi 2021.10.8
charset-normalizer 2.0.10
click 7.1.2
cymem 2.0.6
debugpy 1.5.1
decorator 5.1.1
entrypoints 0.3
fastapi 0.68.2
h11 0.12.0
idna 3.3
importlib-metadata 4.10.0
ipykernel 6.6.1
ipython 7.31.0
jedi 0.18.1
Jinja2 3.0.3
jupyter-client 7.1.0
jupyter-core 4.9.1
langcodes 3.3.0
MarkupSafe 2.0.1
matplotlib-inline 0.1.3
murmurhash 1.0.6
nest-asyncio 1.5.4
numpy 1.21.5
packaging 21.3
parso 0.8.3
pathy 0.6.1
peewee 3.14.8
pexpect 4.8.0
pickleshare 0.7.5
pip 19.0.3
plac 1.1.3
preshed 3.0.6
prodigy 1.11.7
prompt-toolkit 3.0.24
ptyprocess 0.7.0
pydantic 1.8.2
Pygments 2.11.2
PyJWT 2.3.0
pyparsing 3.0.6
python-dateutil 2.8.2
pyzmq 22.3.0
requests 2.27.1
setuptools 40.8.0
six 1.16.0
smart-open 5.2.1
spacy 3.2.1
spacy-legacy 3.0.8
spacy-loggers 1.0.1
srsly 2.4.2
starlette 0.14.2
thinc 8.0.13
toolz 0.11.2
tornado 6.1
tqdm 4.62.3
traitlets 5.1.1
typer 0.3.2
typing-extensions 3.10.0.2
urllib3 1.26.8
uvicorn 0.13.4
wasabi 0.9.0
wcwidth 0.2.5
zipp 3.7.0

Kinly help me to fix this issue.

Hi! I've merged both your threads into one – it's not so helpful to open multiple threads about the same topic in one day and it makes it much more difficult for us to keep track of questions and answer everyone.

How are you running Prodigy and are you sure you're running it with the same Python environment? The error really sounds like you're running an old version of Prodigy so maybe you're accidentally running a different environment here?

Try running the command with python -m prodigy and check which python and which pip to make sure they're referring to the same Python env. If you're still having problems, try a clean install in a fresh virtual environment to make sure you didn't end up in a weird state.

thank you that works