PyInstaller 无法处理简单的 HelloWorld 程序 [英] PyInstaller not working on simple HelloWorld Program

查看:78
本文介绍了PyInstaller 无法处理简单的 HelloWorld 程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

So I am running on 64-bit Windows 7, and I set up Pyinstaller with Pip and PyWin32. I have python 2.7.

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

I made a simple hello world Program with this code

print "hello world!"

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

I put the file in the same directory as PyInstaller, and ran this code in the command prompt

pyinstaller.py helloWorld.py

然而,当我尝试这样做时,我收到此错误消息:

Yet, when I try that, I get this error message:

Error loading Python DLL: C:\PROGRA~1\PYINST~1.1\build\HELLOW~1\python27.dll (error code 126)

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

What am I doing wrong and how do I fix this?

推荐答案

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

Run with the -F flag to produce the standalone exe:

pyinstaller -F helloworld.py

会输出到 dist/helloworld.exe

It will output to dist/helloworld.exe

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

NOTE this is a different location to when -F is not used, be sure to run the right exe afterwards.

这篇关于PyInstaller 无法处理简单的 HelloWorld 程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆