Installation and First Usage Errors Prodigy1.8.5

I have recently installed Prodigy 1.8.5 in a fresh venv.

No matter what I try, I keep getting the following error:

Traceback (most recent call last):
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/usr/local/lib/python3.6/site-packages/prodigy/init.py", line 10, in
from . import recipes # noqa
File "/usr/local/lib/python3.6/site-packages/prodigy/recipes/init.py", line 4, in
from . import dep, ner, textcat, pos, compare, terms, generic, image, review # noqa
File "/usr/local/lib/python3.6/site-packages/prodigy/recipes/dep.py", line 7, in
from ..models.dep import DependencyParser, merge_arcs
File "cython_src/prodigy/models/dep.pyx", line 13, in init prodigy.models.dep
ImportError: cannot import name cleanup_beam

I have searched the support site for this error with no luck. Any ideas what can be causing this?

Hi! That's definitely strange – I think the function it's trying to import is in spaCy, so maybe your versions are out-of-sync? Could you run pip list and check which version of spaCy you have installed?

Hi, Ines! I have an "ImportError: cannot import name cleanup_beam" issue too.

I installed Prodigy (v1.10.5) into the new Conda environment. If I try to check the installation by "python -m prodigy stats" command, I'll get:

Traceback (most recent call last):
File "C:\conda\envs\prodigy\lib\runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "C:\conda\envs\prodigy\lib\runpy.py", line 144, in get_module_details
return get_module_details(pkg_main_name, error)
File "C:\conda\envs\prodigy\lib\runpy.py", line 111, in get_module_details
import(pkg_name)
File "C:\conda\envs\prodigy\lib\site-packages\prodigy_init
.py", line 7, in
from . import recipes
File "C:\conda\envs\prodigy\lib\site-packages\prodigy\recipes_init
.py", line 4, in
from ..deprecated import recipes # noqa
File "C:\conda\envs\prodigy\lib\site-packages\prodigy\deprecated\recipes.py", line 15, in
from ..models.matcher import PatternMatcher
File "C:\conda\envs\prodigy\lib\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 the same result on different computers.

pip list

Package Version


aiofiles 0.6.0
blis 0.7.3
cachetools 4.1.1
catalogue 1.0.0
certifi 2020.11.8
chardet 3.0.4
click 7.1.2
cymem 2.0.4
en-core-web-sm 2.3.1
fastapi 0.44.1
h11 0.9.0
idna 2.10
murmurhash 1.0.4
numpy 1.19.3
peewee 3.14.0
pip 20.2.4
plac 1.1.3
preshed 3.0.4
prodigy 1.10.5
pydantic 1.7.2
PyJWT 1.7.1
requests 2.25.0
setuptools 50.3.1.post20201107
spacy 2.3.3
srsly 1.0.4
starlette 0.12.9
thinc 7.4.3
toolz 0.11.1
tqdm 4.53.0
urllib3 1.26.2
uvicorn 0.11.8
wasabi 0.8.0
websockets 8.1
wheel 0.35.1
wincertstore 0.2

Ah, I now see that other people have the same. Can you try to revert back to Spacy 2.3.2 and see if that works?

@skoetje hi. Thanks. It helped me and the "python -m prodigy stats" command works

Hi Ines,

I also have the same problem. Very weird. All following commands do not work. Could you please help? thank you~

prodigy
python -m prodigy
python -m prodigy stats

Here is what I got after submitting pip list

(base) D:\ProgramData\Anaconda3\Scripts>pip list
Package Version


-ip 19.2.3
aiofiles 0.6.0
alabaster 0.7.12
anaconda-client 1.7.2
anaconda-navigator 1.10.0
anaconda-project 0.8.3
asn1crypto 1.0.1
astroid 2.3.1
astropy 3.2.1
atomicwrites 1.3.0
attrs 19.2.0
Automat 20.2.0
Babel 2.7.0
backcall 0.1.0
backports.functools-lru-cache 1.6.1
backports.os 0.1.1
backports.shutil-get-terminal-size 1.0.0
backports.tempfile 1.0
backports.weakref 1.0.post1
bcrypt 3.2.0
beautifulsoup4 4.8.0
bitarray 1.0.1
bkcharts 0.2
bleach 3.1.0
blis 0.7.4
bokeh 1.3.4
boto 2.49.0
Bottleneck 1.2.1
cachetools 4.2.0
catalogue 1.0.0
certifi 2019.9.11
cffi 1.12.3
chardet 3.0.4
Click 7.0
cloudpickle 1.2.2
clyent 1.2.2
colorama 0.4.1
comtypes 1.1.7
conda 4.9.2
conda-build 3.21.4
conda-package-handling 1.7.2
conda-verify 3.4.2
constantly 15.1.0
contextlib2 0.6.0
cryptography 2.7
cssselect 1.1.0
cycler 0.10.0
cymem 2.0.5
Cython 0.29.13
cytoolz 0.10.0
dask 2.5.2
decorator 4.4.0
defusedxml 0.6.0
distributed 2.5.2
docutils 0.15.2
en-core-web-sm 2.3.1
entrypoints 0.3
et-xmlfile 1.0.1
fastapi 0.44.1
fastcache 1.1.0
filelock 3.0.12
Flask 1.1.1
fsspec 0.5.2
future 0.18.2
gevent 1.4.0
glob2 0.7
greenlet 0.4.15
h11 0.9.0
h5py 2.9.0
HeapDict 1.0.1
html5lib 1.0.1
hyperlink 21.0.0
idna 2.8
imageio 2.6.0
imagesize 1.1.0
importlib-metadata 3.4.0
incremental 17.5.0
ipykernel 5.1.2
ipython 7.8.0
ipython-genutils 0.2.0
ipywidgets 7.5.1
isort 4.3.21
itemadapter 0.2.0
itsdangerous 1.1.0
jdcal 1.4.1
jedi 0.15.1
Jinja2 2.10.3
joblib 0.13.2
json5 0.8.5
jsonschema 3.0.2
jupyter 1.0.0
jupyter-client 5.3.3
jupyter-console 6.0.0
jupyter-core 4.5.0
jupyterlab 1.1.4
jupyterlab-server 1.0.6
keyring 18.0.0
kiwisolver 1.1.0
lazy-object-proxy 1.4.2
libarchive-c 2.8
llvmlite 0.29.0
locket 0.2.0
lxml 4.4.1
MarkupSafe 1.1.1
matplotlib 3.1.1
mccabe 0.6.1
menuinst 1.4.16
mistune 0.8.4
mkl-fft 1.0.14
mkl-random 1.1.0
mkl-service 2.3.0
mock 3.0.5
more-itertools 7.2.0
mpmath 1.1.0
msgpack 0.6.1
multipledispatch 0.6.0
murmurhash 1.0.5
navigator-updater 0.2.1
nbconvert 5.6.0
nbformat 4.4.0
networkx 2.3
nltk 3.4.5
nose 1.3.7
notebook 6.0.1
numba 0.45.1
numexpr 2.7.0
numpy 1.16.5
numpydoc 0.9.1
olefile 0.46
openpyxl 3.0.0
packaging 19.2
pandas 0.25.1
pandocfilters 1.4.2
parsel 1.5.2
parso 0.5.1
partd 1.0.0
path.py 12.0.1
pathlib2 2.3.5
patsy 0.5.1
peewee 3.14.0
pep8 1.7.1
pickleshare 0.7.5
Pillow 6.2.0
pip 20.3.3
pkginfo 1.5.0.1
plac 0.9.6
pluggy 0.13.0
ply 3.11
preshed 3.0.5
prodigy 1.10.5
prometheus-client 0.7.1
prompt-toolkit 2.0.10
psutil 5.6.3
py 1.8.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycodestyle 2.5.0
pycosat 0.6.3
pycparser 2.19
pycrypto 2.6.1
pycurl 7.43.0.3
pydantic 1.7.3
PyDispatcher 2.0.5
pyflakes 2.1.1
Pygments 2.4.2
PyHamcrest 2.0.2
PyJWT 1.7.1
pylint 2.4.2
pyodbc 4.0.27
pyOpenSSL 19.0.0
pyparsing 2.4.2
pyreadline 2.1
pyrsistent 0.15.4
PySocks 1.7.1
pytest 5.2.1
pytest-arraydiff 0.3
pytest-astropy 0.5.0
pytest-doctestplus 0.4.0
pytest-openfiles 0.4.0
pytest-remotedata 0.3.2
pytest-runner 5.2
python-dateutil 2.8.0
pytz 2019.3
PyWavelets 1.0.3
pywin32 223
pywinpty 0.5.5
PyYAML 5.1.2
pyzmq 18.1.0
QtAwesome 0.6.0
qtconsole 4.5.5
QtPy 1.9.0
queuelib 1.5.0
requests 2.22.0
rope 0.14.0
ruamel-yaml 0.15.46
scikit-image 0.15.0
scikit-learn 0.21.3
scipy 1.3.1
Scrapy 2.4.1
seaborn 0.9.0
Send2Trash 1.5.0
service-identity 18.1.0
setuptools 41.4.0
simplegeneric 0.8.1
singledispatch 3.4.0.3
six 1.12.0
snowballstemmer 2.0.0
sortedcollections 1.1.2
sortedcontainers 2.1.0
soupsieve 1.9.3
spacy 2.3.3
Sphinx 2.2.0
sphinxcontrib-applehelp 1.0.1
sphinxcontrib-devhelp 1.0.1
sphinxcontrib-htmlhelp 1.0.2
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.2
sphinxcontrib-serializinghtml 1.1.3
sphinxcontrib-websupport 1.1.2
spyder 3.3.6
spyder-kernels 0.5.2
SQLAlchemy 1.3.9
srsly 1.0.5
starlette 0.12.9
statsmodels 0.10.1
sympy 1.4
tables 3.5.2
tblib 1.4.0
terminado 0.8.2
testpath 0.4.2
thinc 7.4.4
toolz 0.10.0
tornado 6.0.3
tqdm 4.56.0
traitlets 4.3.3
Twisted 20.3.0
typing-extensions 3.7.4.3
unicodecsv 0.14.1
urllib3 1.24.2
uvicorn 0.11.8
w3lib 1.21.0
wasabi 0.8.0
wcwidth 0.1.7
webencodings 0.5.1
websockets 8.1
Werkzeug 0.16.0
wheel 0.33.6
widgetsnbextension 3.5.1
win-inet-pton 1.1.0
win-unicode-console 0.5
wincertstore 0.2
wrapt 1.11.2
xlrd 1.2.0
XlsxWriter 1.2.1
xlwings 0.15.10
xlwt 1.3.0
xmltodict 0.12.0
zict 1.0.0
zipp 0.6.0
zope.interface 5.2.0

It looks like you might have ended up with an older version of spaCy in your environment that you installed Prodigy into? Maybe you already had your environment set up and it didn't pull in the latest version? Can you try and upgrade spaCy to the latest stable version?

Thank you Ines. I updated to spacy 2.3.5. And seems that it works using python -m prodigy.

You should be able to just run pip install -U spacy to update it to the latest version.