我想用 cx_freeze 分发我的 Python 项目。但是在执行 exe 文件时,我收到标题中提到的错误消息:导入 win32ui 时 DLL 加载失败。
我已经尝试了一些在这里发布的解决方案,例如在分发文件夹中包含“Pythonwin”文件夹和两个 dll 文件,或者使用“py2exe”代替,但它们都不起作用。尽管“win32ui.pyd”、“mfcm140u.dll”和“mfc140u.dll”都在发行版的“lib”文件夹中。
这是我想要分发的 py 文件:https://github.com/DeatorFM/Redemption-Tracker
这是我准备的setup.py:
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
# "packages": ["os"] is used as example only
# build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}
# base="Win32GUI" should be used only for Windows GUI app
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "RedTrack",
version = "1.0",
description = "App um Einlösungen von Kanalpunkten zu tracken",
executables = [Executable("Redempttracker_UI.py", base=base)]
)
我很感激每一个建议。
答案 0 :(得分:0)
问题解决了!
我尝试在调试模式下使用 pyinstaller,但显然 pywintypes39.dll 丢失了,所以我将它包含在 dist 文件中。