在其他计算机上从 cx_Freeze 而不是 运行 生成的可执行文件

Executable file generated from cx_Freeze not running on other computers

为了将我的 python 文件转换为可执行文件,我使用了以下 'setup.py' 文件。 'build' 目录中生成的可执行文件在我的笔记本电脑上可以完美执行,但在我兄弟的笔记本电脑上根本无法 运行(我使用 cx_Freeze 来执行此操作)。 我的笔记本电脑和我的兄弟们完全一样。唯一的区别是:我安装了 Python 3.4.4(以及 Pygame)而他没有,我安装了 Windows 8 而他安装了 Windows 10。我找不到问题。是因为 'cx_Freeze' 吗?是因为我有Python而他没有吗?当然,可执行文件应该 运行 在任何 windows 计算机上......下面是我的 'setup.py' 文件。

from cx_Freeze import setup, Executable

setup(
    name = "Pythongame",
    version = "1.0",
    description = "Game made with Pygame",
    executables = [Executable("Pythongame.py", base="Win32GUI")],
    )

非常感谢任何帮助!

注意:我需要 base="Win32GUI" 因为 pygame 创建了一个 GUI

是的,你需要复制所有的目录像构建因为他包含库(dll和其他)
或者这个 exe 只是为你的 windows 生成的,比如 (win7 64bit)
我建议你使用 Pyinstaller