When using py2exe, PyQt application cannot load SQlite database

后端 未结 3 610
轮回少年
轮回少年 2021-01-16 07:12

My PyQt application works fine when running on Linux, when in my Windows build environment, or frozen on the machine where it was build with py2exe. But after moving the fro

3条回答
  •  被撕碎了的回忆
    2021-01-16 08:06

    DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far ...

    The accepted answer doesn't really say what dlls they copied and in what places. I managed to fix it by copying the driver inside the sqldrivers directory relative to where the exe and qt dlls are (I'm using PySide but should work with PyQt4 as well). In setup.py:

    setup(
        ...,
        data_files = [('sqldrivers', ('C:\Python27\Lib\site-packages\PySide\plugins\sqldrivers\qsqlite4.dll',))],
        ...,
    )
    

提交回复
热议问题