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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -