MySQL: ‘NoneType’ object has no attribute ‘Binary’

I am installing prodigy on top of an ubuntu box.

I installed spacy and downloaded multilang.
now i am trying to run a simple dataset command using “prodigy dataset my_test_set”
and get the following:

Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/omri/.local/lib/python3.6/site-packages/prodigy/main.py”, line 372, in
plac.call(commands[command], arglist=args, eager=False)
File “/home/omri/.local/lib/python3.6/site-packages/plac_core.py”, line 328, in call
cmd, result = parser.consume(arglist)
File “/home/omri/.local/lib/python3.6/site-packages/plac_core.py”, line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File “/home/omri/.local/lib/python3.6/site-packages/prodigy/main.py”, line 45, in dataset
DB = connect()
File “/home/omri/.local/lib/python3.6/site-packages/prodigy/components/db.py”, line 75, in connect
_DB = Database(db, db_id, db_name)
File “/home/omri/.local/lib/python3.6/site-packages/prodigy/components/db.py”, line 152, in init
DB_PROXY.initialize(db)
File “/home/omri/.local/lib/python3.6/site-packages/peewee.py”, line 431, in initialize
callback(obj)
File “/home/omri/.local/lib/python3.6/site-packages/peewee.py”, line 1197, in _set_constructor
self._constructor = database.get_binary_type()
File “/home/omri/.local/lib/python3.6/site-packages/peewee.py”, line 4377, in get_binary_type
return mysql.Binary
AttributeError: ‘NoneType’ object has no attribute ‘Binary’

can you tell what id the issue?

Hi! The error seems to occur when peewee fails to connect to the database. It looks like you’ve set up Prodigy to use MySQL, but you might not have a driver installed, and/or the database isn’t configured correctly? See this thread for details:

1 Like

thank you,

so i installed a driver using:
python3 -m pip install PyMySQL

it works like a charm.