.app 包,使用 pyinstaller,不 运行 在其他 Mac
.app bundle, using pyinstaller, doesn't run on other Mac
我在将使用 pyinstaller 制作的 .app 包发送到另一个人的 Mac 上 运行 时遇到了一些问题。
两台计算机 运行ning macOS 10.13.2 和 Python 3.6.
在我的 Mac 上是 运行s 就像我 运行 .py 文件时一样。
在对方的Mac上,图标在他的托盘里弹出了一会儿,弹了一两下就消失了。当它在尝试打开应用程序时保持打开状态时,它永远不会出现在强制退出 window 中。
这是规范文件:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['Shadowmaster.py'],
pathex=['/Users/jacob/Dropbox/Games/Shadowrun/Python/Shadowmaster'],
binaries=[],
datas=[],
hiddenimports=['sys', 'webbrowser', 'random', 'decimal', 'collections', 'tkinter', 'tracback'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='Shadowmaster',
debug=False,
strip=False,
upx=True,
console=False , icon='icon.icns')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='Shadowmaster')
app = BUNDLE(coll,
name='Shadowmaster.app',
icon='icon.icns',
bundle_identifier=None,
info_plist={'CFBundleDisplayName': 'Shadowmaster',
'CFBundleName': 'Shadowmaster',
'CFBundleIdentifier': 'Shadowmaster',
'CFBundleExecutable': 'MacOS/Shadowmaster',
'CFBundleIconFile': 'icon.icns',
'CFBundleInfoDictionaryVersion': '6.0',
'CFBundlePackageType': 'APPL',
'CFBundleShortVersionString': '0.0.6',
'LSBackgroundOnly': '0',
'NSHighResolutionCapable': 'True'})
程序有几千行,但这里是导入,我怀疑可能是以下原因:
import sys
from webbrowser import open_new as open_browser
from random import SystemRandom
from time import sleep
import decimal
from collections import OrderedDict
import tkinter as tk
import tkinter.ttk as ttk
import traceback
import tkinter.messagebox
有什么建议吗?
原来对方需要安装ActiveTCL 8.5
我在将使用 pyinstaller 制作的 .app 包发送到另一个人的 Mac 上 运行 时遇到了一些问题。
两台计算机 运行ning macOS 10.13.2 和 Python 3.6.
在我的 Mac 上是 运行s 就像我 运行 .py 文件时一样。
在对方的Mac上,图标在他的托盘里弹出了一会儿,弹了一两下就消失了。当它在尝试打开应用程序时保持打开状态时,它永远不会出现在强制退出 window 中。
这是规范文件:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['Shadowmaster.py'],
pathex=['/Users/jacob/Dropbox/Games/Shadowrun/Python/Shadowmaster'],
binaries=[],
datas=[],
hiddenimports=['sys', 'webbrowser', 'random', 'decimal', 'collections', 'tkinter', 'tracback'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='Shadowmaster',
debug=False,
strip=False,
upx=True,
console=False , icon='icon.icns')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='Shadowmaster')
app = BUNDLE(coll,
name='Shadowmaster.app',
icon='icon.icns',
bundle_identifier=None,
info_plist={'CFBundleDisplayName': 'Shadowmaster',
'CFBundleName': 'Shadowmaster',
'CFBundleIdentifier': 'Shadowmaster',
'CFBundleExecutable': 'MacOS/Shadowmaster',
'CFBundleIconFile': 'icon.icns',
'CFBundleInfoDictionaryVersion': '6.0',
'CFBundlePackageType': 'APPL',
'CFBundleShortVersionString': '0.0.6',
'LSBackgroundOnly': '0',
'NSHighResolutionCapable': 'True'})
程序有几千行,但这里是导入,我怀疑可能是以下原因:
import sys
from webbrowser import open_new as open_browser
from random import SystemRandom
from time import sleep
import decimal
from collections import OrderedDict
import tkinter as tk
import tkinter.ttk as ttk
import traceback
import tkinter.messagebox
有什么建议吗?
原来对方需要安装ActiveTCL 8.5