问题
I am using cx_Freeze to convert my python program to an exe. It all runs fine when it is a .py however when I come to run the exe, I get the following traceback;
Traceback (most recent call last):
File "UCA_Starter.py", line 45, in <module>
File "UCA_Starter.py", line 39, in main
File "C:\Python26\Scripts\ClientSelector.py", line 20, in <module>
import login_d
File "C:\Python26\Scripts\login_d.py", line 6, in <module>
import ad_auth
File "C:\Python26\Scripts\ad_auth.py", line 1, in <module>
import ldap
File "C:\Python26\lib\site-packages\ldap\__init__.py", line 22, in <module>
from _ldap import *
File "ExtensionLoader_ldap__ldap.py", line 12, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.
I have googled the problem but I am still not sure what it even means or if it is a problem with cx_Freeze or the module or if i'm just missing dll's. Any help would be much appreciated. Thanks in advance!
回答1:
Try to install the 32bit version of the cx_Freeze. That worked for me.
来源:https://stackoverflow.com/questions/8597126/cx-freeze-ldap-importerror-dll-load-failed-1-is-not-a-valid-win32-application