File "/usr/local/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/local/lib/python3.7/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/opt/deployment/venv/lib/python3.7/site-packages/prodigy/__init__.py", line 9, in <module>
from . import recipes # noqa
File "/opt/deployment/venv/lib/python3.7/site-packages/prodigy/recipes/__init__.py", line 4, in <module>
from . import dep, ner, textcat, pos, compare, terms, generic, image # noqa
File "/opt/deployment/venv/lib/python3.7/site-packages/prodigy/recipes/dep.py", line 12, in <module>
from ..components.loaders import get_stream
File "cython_src/prodigy/components/loaders.pyx", line 4, in init prodigy.components.loaders
File "/usr/local/lib/python3.7/bz2.py", line 19, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
I am getting the above when I am trying to use any of the prodigy commands. Checked stackoverflow none of them are working. Please can you help us out.
prodigy stats -l
prodigy dataset temp 'temp db'
It looks like your OS is probably missing the BZ2 decompression library. I think I provided the following list of Ubuntu packages in the other thread. Iām not sure what the CentOS equivalents are, but you should double-check you have the equivalents installed on your servers, to make sure everything works smoothly:
I have the same issue on debian python 3.8.1. I could apt install all the packages mentioned by @honnibal. @vajja did you manage to solve it or did you change OS?
@nix411 Did you reinstall/recompile Python afterwards? The issue seems to be pretty common (see here) and the solution typically involves installing BZ2 and then reconfiguring and recompiling Python.
Just ran into this issue again (last I just used another OS I think). This time I
sudo apt-get install libbz2-dev
and then recompiled Python 3.8.1 . It fixed the initial issue BUT now I get
Process Process-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/local/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/alba/plx_python/util/prodigy/multisessions.py", line 46, in serve
prodigy.serve(
File "/opt/alba/venv/lib/python3.8/site-packages/prodigy/__init__.py", line 36, in serve
controller = loaded_recipe(*cli_args, use_plac=True)
File "cython_src/prodigy/core.pyx", line 231, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File "cython_src/prodigy/core.pyx", line 71, in prodigy.core.Controller.__init__
File "cython_src/prodigy/core.pyx", line 187, in prodigy.core.Controller.connect_db
File "/opt/alba/venv/lib/python3.8/site-packages/prodigy/components/db.py", line 72, in connect
_DB = Database(db, db_id, db_name)
File "/opt/alba/venv/lib/python3.8/site-packages/prodigy/components/db.py", line 180, in __init__
DB_PROXY.initialize(db)
File "/opt/alba/venv/lib/python3.8/site-packages/peewee.py", line 421, in initialize
callback(obj)
File "/opt/alba/venv/lib/python3.8/site-packages/peewee.py", line 4641, in _db_hook
self._constructor = database.get_binary_type()
File "/opt/alba/venv/lib/python3.8/site-packages/peewee.py", line 3607, in get_binary_type
return sqlite3.Binary
AttributeError: 'NoneType' object has no attribute 'Binary'