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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -