Skip to main content
 首页 » 编程设计

python-2.7之PyInstaller 无法处理简单的 HelloWorld 程序

2025年02月15日24soundcode

所以我在 64 位 Windows 7 上运行,我用 Pip 和 PyWin32 设置了 Pyinstaller。我有 python 2.7。

我用这段代码做了一个简单的hello world程序

print "hello world!" 

我将文件放在与 PyInstaller 相同的目录中,并在命令提示符下运行此代码
pyinstaller.py helloWorld.py 

然而,当我尝试这样做时,我收到此错误消息:
Error loading Python DLL: C:\PROGRA~1\PYINST~1.1\build\HELLOW~1\python27.dll (error code 126) 

我做错了什么,我该如何解决?

请您参考如下方法:

使用 -F 标志运行以生成独立的 exe:

pyinstaller -F helloworld.py 

它将输出到 dist/helloworld.exe

注意这与不使用 -F 时的位置不同,请确保之后运行正确的 exe。