python - 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
解决方案
类名Connection
在回购https://github.com/KehaoWu/pgdb/blob/master/pgdb/pgdb.py#L15
PYPY 项目 pypi.org/project/pgdb
推荐阅读
- android - 如何向我的 Expo React Native 应用程序添加“不受支持”的权限?
- jenkins - 常规:MissingPropertyException:没有这样的属性:
- python-3.x - Python 中的 list1 和 list1[:] 有什么区别?
- javascript - 获取未捕获的错误:Reference.set 失败:尝试将数据保存到 Firebase 存储时,第一个参数在属性中包含未定义
- html - 位置:粘性;忽略 z-index / Bootstrap 3 菜单折叠在粘性元素下方
- python - 我将如何在 Python 中运行命令行?
- python - 使用 pyyaml/ruamel.yaml 有条件地转储属性
- sublimetext3 - 关闭 Sublime Text Emmet 包中的文本下划线
- python - 为什么我在使用 pygame 的 key.get_pressed 功能时不能在屏幕上输入文本?
- if-statement - 是否可以创建一个公式,根据查找列表检查行中的某些单元格并返回真/假值?