python - psycopg2: AttributeError: 'module' object has no attribute 'extras' -
in code use dictcursor
psycopg2.extras
this
dict_cur = conn.cursor(cursor_factory=psycopg2.extras.dictcursor)
however, of sudden following error when load cursor:
attributeerror: 'module' object has no attribute 'extras'
maybe dorked in installation have no clue start looking. made updates pip, far know no dependencies of psycopg2
.
you need explicitly import psycopg2.extras
:
import psycopg2.extras
Comments
Post a Comment