bossi
bossi

Reputation: 1673

PySide (1.1.2), cx_freeze, WinXP, Python 3.3: ImportError: DLL load failed

I am trying to freeze Python 3.3 code that uses PySide libs using cx_freeze and all of that on Windows XP (x86, SP2/3).

The python setup.py build runs successfully but the executable throws an ImportError:

ImportError: DLL load failed: This application has failed to start because the application configuration is incorrect. Reinstalling [...]

The same builds run perfectly fine on Windows 7 x64 (SP1).

The versions I am using are as follows:

Both QT DLL libraries get copied to the build folder (QtCore.dll, QtGui.dll), the library-zip contains both .pyc equivalents in the PySide folder/module.

This issue occurs even with the simplest test-code (and also if the code is run on a "live" Python installation as well*):

from PySide import QtCore, QtGui

if __name__ == "__main__":
    app = QtGui.QApplication("My Application")
    win = QtGui.QMainWindow()
    win.show()
    app.exec_()

Using a more up-to-date version of PySide might fix the problem, but since PySide 1.2.0 introduces a new issue with cx-freeze (the file load error) I was wondering if anyone managed to freeze a PySide package on Windows XP stock successfully?

Otherwise will have to wait until PySide 1.2.1 gets published and keep my hopes for that release.

Upvotes: 1

Views: 1017

Answers (2)

mxl
mxl

Reputation: 667

I had a similar issue in the past and was able to resolve it by downloading the "Microsoft Visual C++ 2008 Redistributable Package (x86)".

Upvotes: 0

bossi
bossi

Reputation: 1673

Turned out there was a simple solution to the issue: A DLL from another module in use by the application was missing; copying it into the root build-out folder next to the frozen EXE easily solved the problem.

The best (and probably only) approach of attack to solve these issues probably is to copy all DLLs from used modules into the build dir one by one until the frozen build doesn't throw the error anymore. I couldn't find another way as the stacktrace didn't point to a specific file that failed loading.

If anyone runs into similar issues, I'd be happy to provide extra info.

Upvotes: 2

Related Questions