python + cx_freeze 'cannot get zipimporter instance'

python + cx_freeze 'cannot get zipimporter instance'

我看到 one question 与此相关,但它并没有真正回答我的问题。

我编写了一个无需安装 python 即可使用的程序;我使用 cx_freeze 来实现这一点。我在cmd里写了一个setup.py,运行。这一切都很好,虽然我确实收到了一些 'missing module' 警告,但它向我保证这可能不是问题:

    Missing modules:
? _dummy_threading imported from dummy_threading
? ce imported from os
? doctest imported from heapq
? getopt imported from base64, quopri
? grp imported from shutil, tarfile
? org.python.core imported from copy
? os.path imported from os, py_compile, shutil
? posix imported from os
? pwd imported from posixpath, shutil, tarfile
? subprocess imported from os
This is not necessarily a problem - the modules may not be needed on this platform.

(我是 运行宁 Windows 8,从来没有抽出时间更新到 8.1)

导出后,我看到两个文件; 'python34.dll' 和 'T-Backup.exe'。当我 运行 T-backup.exe 我得到上面的错误。

这是我的 setup.py 以备不时之需:

import sys
from cx_Freeze import setup, Executable

base = None
if (sys.platform == "win32"):
    base = "Win32GUI"

exe = Executable(
        script = "<path>\T-Backup.py",
        icon = "<path>\Icon.ico",
        targetName = "<path>\exe\T-Backup.exe",
        base = base
        )
includefiles = ["<path>\Icon.ico","<path>\backupfrom.tbk","<path>\backupto.tbk"]

setup(
    name = "T-Backup",
    version = "0.1",
    description = "Backs up Terraria Worlds and Players.",
    author = "Sam Poirier (darthmorf)",
    options = {'build_exe': {'include_files':includefiles}},
    executables = [exe]



)

感谢您的帮助。

-达斯莫夫

我不能评论,所以我回答:

我认为你在 64 位系统上,你永远不会得到 'None' 以外的基础。尝试改变

base = None
if (sys.platform == "win32"):
    base = "Win32GUI"

base = "Win32GUI"

这解决了我的很多问题,这些问题与您描述的类似...

如果你能显示你实际导入了哪些模块,那么我可能会有更多用处。