Python cx\U冻结生成应用程序,但显示错误:**不是Mach-O文件
我正在尝试用cx\u freeze制作一个python应用程序。我使用了Python cx\U冻结生成应用程序,但显示错误:**不是Mach-O文件,python,cx-freeze,Python,Cx Freeze,我正在尝试用cx\u freeze制作一个python应用程序。我使用了cxfreeze quickstart选项来创建安装文件。它是一个使用tkinter GUI的基本应用程序,只有两个导入语句,都是标准python库:from tkinter import Tk;导入网络浏览器 以下是setup.py: from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it migh
cxfreeze quickstart
选项来创建安装文件。它是一个使用tkinter GUI的基本应用程序,只有两个导入语句,都是标准python库:from tkinter import Tk;导入网络浏览器
以下是setup.py:
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = [], excludes = [])
import sys
base = 'Win32GUI' if sys.platform=='win32' else None
executables = [
Executable('TheApp.py', base=base)
]
setup(name='TheApp',
version = '1.0',
description = 'Basic App',
options = dict(build_exe = buildOptions),
executables = executables)
当我运行python3 setup.py bdist_mac
创建.app
时,它会运行并编译一个应用程序,但它会运行数百个文件,表明存在错误(最后一个出现的错误):
错误:/Library/Developer/CommandLineTools/usr/bin/install\u name\u工具:输入文件:build/TheApp-1.0.app/Contents/MacOS/lib/email//u encoded\u words.pyc不是Mach-O文件
当我点击
.app
时,它会立即打开和关闭。如果我转到app/build/exe.macosx-10.6-intel-3.6/文件夹并单击名为app的Unix可执行文件,它将打开并正常运行。如果我尝试bdist_dmg选项,结果是相同的。是否有人知道如何修复Mach-O错误,或者如果这不是问题所在,如何解决此问题?我们收到大量此类错误,并且应用程序仍能正常工作。。。。我认为问题不在于这些错误。