When using py2exe, PyQt application cannot load SQlite database

后端 未结 3 611
轮回少年
轮回少年 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 07:55

    Try to re-install SOLite, or verify if you have putted the DLL in the correct place, because i remember that the MySQL DLL have to be in System32 directory to develop something that uses it.

    Regards.

    0 讨论(0)
  • 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',))],
        ...,
    )
    
    0 讨论(0)
  • 2021-01-16 08:09

    I solved it!

    I had a really clever way to avoid making my users install vcredist--I copied the manifest and the DLLs into two places and all the errors about the MS DLLs went away. That's when I started trying to figure out this SQLite driver error.

    I wasn't as smart as I thought. If I install vcredist all the "Driver Not Loaded" and "No SQL drivers found" errors go away. Arg.

    0 讨论(0)
提交回复
热议问题