Py2exe、PyQt4 和 Postgre 驱动程序 (QPSQL)
我正在尝试使用 Py2exe 冻结我的应用程序。
我的应用程序使用 PyQt4,它显然与 py2exe 配合得很好。但是一旦我卸载了PyQt,它就会显示以下错误:
QSqlDatabase:QPSQL驱动程序未加载 QSqlDatabase:可用驱动程序:QPSQL7 QPSQL
这根本没有任何意义。驱动是可以的,但是我用不了!如果仍然安装 PyQt4,它就可以正常工作。
这是我的 py2exe 参数:
data_files = [
('sqldrivers', [
'C:\Python26\Lib\site-packages\PyQt4\plugins\sqldrivers\qsqlpsql4.dll'
])
]
setup(console=["delivery.py"], options={"py2exe" : {"includes" : ["sip", "PyQt4.QtSql", "PyQt4.QtWebKit", "PyQt4.QtNetwork"]}}, data_files=data_files)
I`m trying to freeze my application using Py2exe.
My app uses PyQt4 and it apparently works fine with py2exe. But once I`ve uninstalled PyQt, it shows the following error:
QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QPSQL7 QPSQL
Which doesn't make any sense at all. The driver is available, but I can't use it! If PyQt4 is still installed, it works just fine.
This is my py2exe parameters:
data_files = [
('sqldrivers', [
'C:\Python26\Lib\site-packages\PyQt4\plugins\sqldrivers\qsqlpsql4.dll'
])
]
setup(console=["delivery.py"], options={"py2exe" : {"includes" : ["sip", "PyQt4.QtSql", "PyQt4.QtWebKit", "PyQt4.QtNetwork"]}}, data_files=data_files)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了。
只需将文件“libpq.dll”复制到应用程序文件夹即可,它就像一个魅力。
Found it.
Just copy the file 'libpq.dll' to the application folder and it works like a charm.