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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -