gpt4 book ai didi

python - Pyinstaller,名称错误 : global name 'quit' is not defined

转载 作者:太空狗 更新时间:2023-10-30 00:21:44 26 4
gpt4 key购买 nike

我有一个运行良好的 python 脚本,但是在运行 pyinstaller 之后,当我使用 quit()exit() 命令时,我得到以下信息:

Makespec 文件:

# -*- mode: python -*-
a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'), os.path.join(HOMEPATH,'support/useUnicode.py'), 'icinga.py'],
pathex=['/home/user/projects/icinga_python/releases/onefile_v1.0'])
pyz = PYZ(a.pure)
exe = EXE( pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name=os.path.join('dist', 'icinga'),
debug=False,
strip=False,
upx=True,
console=1 )

这是我运行该应用程序后看到的内容:

Traceback (most recent call last):
File "<string>", line 222, in <module>
File "<string>", line 207, in main
File "<string>", line 66, in icinga_mysql
File "<string>", line 45, in checksanity
NameError: global name 'quit' is not defined

最佳答案

那是因为没有quit命令。您正在寻找sys.exit .

关于python - Pyinstaller,名称错误 : global name 'quit' is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7474291/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com