【发布时间】:2017-01-21 09:10:48
【问题描述】:
我创建了一个小脚本来测试 cx_Freeze,如下所示:
sqrt.py:
import math
sqrt = math.sqrt
x = float(input('Enter a number:'))
y = sqrt(x)
print(y)
input('Press ENTER to exit')
我还创建了一个设置脚本:
setup.py:
from cx_Freeze import setup, Executable
setup( name = "sqrt",
version = "0.1",
description = "Testing",
# options = {"build_exe": build_exe_options},
executables = [Executable("sqrt.py")])
接下来,我在python.exe、sqrt.py和setup.py所在的文件夹中启动Windows cmd.exe并输入:
路径\python.exe setup.py build
这将创建一个构建目录,其中包含一个 sqrt.exe。当我尝试执行此操作时,它会返回
“应用程序无法正确启动(0xc000007b)。单击确定 关闭应用程序。”
据我了解 cx_Freeze 文档,这应该有效。我看过的各种 YouTube 教程也是如此。
我正在运行 Windows10 64x、Python 3.5 和 cx_freeze 5.0。
【问题讨论】:
-
什么版本的 Windows?
-
@Soviut 添加到帖子中。 Windows 10。
-
你见过这个相关的问题吗? stackoverflow.com/questions/20650596/…