Pergunta

I'm using CXFreeze with PySide (QT). I get an error: cx_Freeze: Python error in main script. myscript.py line 33, in File ExtensionLoader_Pyside_QtGUI.py, line 11, in Import Error: DLL load failed: The specified module could not be found

When running a fresh install of Windows server 2008. I'm running the frozen EXE package (with the folder). It seems to work on my own system and other systems. What might be the issue?

After reading, online, I tried to replace the Qt4Gui file, but this didn't solve the issue.

Python version is 2.7

Foi útil?

Solução 3

I used Py2exe instead of CXFreeze and it worked perfectly.

Also, apparently Python requires the MS Visual C++ Dependency Files: http://www.microsoft.com/en-us/download/details.aspx?id=29 So any bundling needs that as well, if it's a fresh install. (Although I think they are now bundled with newer Windows versions.)

Other Notes: In my experience, sometimes you should try CXFreeze, Py2EXE and PyInstaller quickly and see if one works best. As ideal as CXFreeze is re: cross platform, it just isn't going to happen perfectly.

Also, while I don't know if this was a factor, I set up a Windows 2000 Pro virtual machine and ran Py2exe on that. That was to ensure compatibility for all older Windows versions, and seemed to work well. (NOTE: Many things won't even run on Win2000 anymore so be careful that your other tools and libraries will run on it.)

Finally, be extra careful to match the bit level (32 vs 64) of all your libraries, and your Python install itself. If you have 32-bit python, ensure that your PySide, CXFreeze and any other libraries you use are 32-bit. (Or 64-bit if you're using 64-bit python.)

Outras dicas

Based on your Import Error: DLL load failed it is most likely an installation issue causing the missing DLL. To figure our exactly which DLL you are missing, use http://www.dependencywalker.com/ Run the .exe and open the .pyd file for File ExtensionLoader_Pyside_QtGUI.py and it will show you exactly which DLL's are missing and more importantly the locations where they should be. You can probably then track down the missing DLL online.

there are known issues with pyside 1.2.0 and cxFreeze. All should be fixed in development version (available on git repo). Please build the PySide from latest sources yourself or wait for PySide version 1.2.1. Build instructions are here [1].

[1] https://github.com/PySide/pyside-setup#building-pyside-on-a-windows-system

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top