cx_Freeze ImportError: DLL load failed failed while importing _ctypes: The specified module could not be found

cx_Freeze ImportError: DLL load failed failed while importing _ctypes: The specified module could not be found

我用 cx_Freeze 编译了一些 Python 脚本,但编译的脚本给我这个错误:

setup.py:

from cx_Freeze import setup, Executable

executables = [
    Executable('USBAIO.py', base="Win32GUI", icon="Icons\icon.ico"),
    Executable('ui.py', base="Win32GUI", icon="Icons\icon.ico"),
    Executable("formatter.py", base="Win32GUI", icon="Icons\cicon.ico"),
    Executable("updater.py", base="Win32GUI", icon="Icons\uicon.ico"),
    Executable("permremove.py", base="Win32GUI", icon="Icons\cicon.ico")
    ]

Packages = ["tkinter","functools", "time", "win32api",
                    "threading", "subprocess", "psutil", "os",
                    "shutil", "re", "requests", "sys", "ctypes",
                    "argparse", "google_drive_downloader",
                    "win32file", "win32con"
                    ]

Include = ["Icons", "version.txt", "icon.ico"]

setup(
    name="myapp",
    options={"build_exe":{"packages":Packages,"include_files":Include}},
    description = "myapp",
    executables = executables
)

Python version: 3.8

Windows: 8.1 Pro WMC

cx_Freeze: 6.0b1

嗯,我找到了答案。 cx_Freeze无法抓取的DLL导致的错误。 当我将 libffi-7.dll 复制到 lib 文件夹时,我的应用程序工作正常。 这是我的研究:research