我想通过pyinstaller生成此脚本,但是.EXE为什么不起作用?
这是来自Github的完整代码:https://github.com/blourabie/b。
这是setup.py代码:
from setuptools import setup
APP = ["main.py"]
APP_NAME = "TEST"
APP_VERSION = "0.0.1"
DATA_FILES = ["lib", "data", "components", "pages"]
OPTIONS = {
"argv_emulation": True,
"iconfile": "data/image/128.icns",
"plist": {
"CFBundleName": APP_NAME,
"CFBundleDisplayName": APP_NAME,
"CFBundleGetInfoString": "doudoudzj",
"CFBundleIdentifier": "com.crogram.osx.application",
"CFBundleVersion": APP_VERSION,
"CFBundleShortVersionString": APP_VERSION,
"NSHumanReadableCopyright": "Copyright © 2018, Crogram, Inc., All Rights Reserved",
},
}
setup(
app=APP,
data_files=DATA_FILES,
options={"pyinstaller": OPTIONS},
setup_requires=["pyinstaller"],
)
我通过代码pyinstaller --onefile -w setup.py
生成工作正常,但是从CMD运行应用程序setup.exe后,我看到错误消息:
PS C:\Users\JOHN\Desktop\T\tkinter-gui-application-examples-master\dist> setup.exe
setup.exe : The term 'setup.exe' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ setup.exe
+ ~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (setup.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command setup.exe was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\setup.exe". See "get-help about_Command_Precedence" for more details.
运行应用程序后,我看到此屏幕: