首页 > 解决方案 > AttributeError:'module'对象在使用python的pgdb模块中没有属性'connect'

问题描述

    import pgdb
    myConnection = pgdb.connect( host=hostname, user=username, password=password, database=database )
    doQuery( myConnection )
    myConnection.close()

运行脚本时出现以下错误。

>>> AttributeError: 'module' object has no attribute 'connect'. Please help me out

标签: pythonpostgresqlpgdb

解决方案


类名Connection在回购https://github.com/KehaoWu/pgdb/blob/master/pgdb/pgdb.py#L15

PYPY 项目 pypi.org/project/pgdb


推荐阅读