cx_Freeze/ldap:导入错误:DLL 加载失败 %1 不是有效的 Win32 应用程序

发布于 2024-12-22 10:01:55 字数 831 浏览 1 评论 0原文

我正在使用 cx_Freeze 将 python 程序转换为 exe。当它是 .py 时,一切都运行良好,但是当我运行 exe 时,我得到以下回溯;

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.

我已经用谷歌搜索了这个问题,但我仍然不确定它意味着什么,或者它是否是 cx_Freeze 或模块的问题,或者我是否只是缺少 dll。任何帮助将不胜感激。提前致谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剧终人散尽 2024-12-29 10:01:55

尝试安装 32 位版本的 cx_Freeze。这对我有用。

Try to install the 32bit version of the cx_Freeze. That worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文