psycopg2 AttributeError module object has no attribute extras

2024-04-25 12:55:53 发布

您现在位置:Python中文网/ 问答频道 /正文

在我的代码中,我像这样使用psycopg2.extras中的^{}

dict_cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)

但是,在加载光标时,突然出现以下错误:

AttributeError: 'module' object has no attribute 'extras'

也许我的装置有点问题,但我不知道从哪里开始找。我用pip做了一些更新,但是据我所知没有psycopg2的依赖项。


Tags: 代码extrasobjectfactory错误conncursorpsycopg2