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

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -