我觉得在过去的20个小时里我已经尽力了,但好像什么都不起作用。我的应用程序正在运行并且工作正常 - 就像应该的那样 - 我唯一的问题是无法从中创建一个 .app
包。我尝试了 Py2App
和 cx_Freeze
,但它们都没有起作用。因为需要支持多平台,如果可能的话,我会坚持使用后者。
setup.py
看起来像这样:
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
OPTIONS = {'build_exe': {'includes': ['sip',
'PyQt5',
'PyQt5.QtCore',
'PyQt5.QtGui',
'PyQt5.QtWidgets',
'PyQt5.QtMultimediaWidgets',
'PyQt5.QtMultimedia',
'PyQt5.QtNetwork']}}
EXECUTABLES = [Executable('main.py', base=base)]
NAME = 'coublet'
VERSION = '0.5.70'
setup(name = NAME,
version = VERSION,
options = OPTIONS,
executables = EXECUTABLES)
我收到的错误信息是:
objc[28404]: Class NotificationReceiver is implemented in both
/Users/.../build/coublet-0.5.70.app/Contents/MacOS/QtWidgets and
/usr/local/Cellar/qt5/5.3.1/lib/QtWidgets.framework/Versions/5/QtWidgets. One of
the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x7fc4b96e98b0) is not the object's thread
(0x7fc4b95dbc80).
Cannot move to target thread (0x7fc4b96e98b0)
On Mac OS X, you might be loading two sets of Qt binaries into the same process.
Check that all plugins are compiled against the right Qt binaries. Export
DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
This application failed to start because it could not find or load the Qt
platform plugin "cocoa".
Available platform plugins are: cocoa, minimal, offscreen.
Reinstalling the application may fix this problem.
Abort trap: 6
我的系统信息:
Mac OS X : 10.9.4
Python : 3.4.1
cx_Freeze : 0.9
PyQt5: : 5.3.1
- - -
Packages installed via: Homebrew and PIP
.app
结构:
build/coublet-0.5.70.app
└── Contents
├── Frameworks
├── Info.plist
├── MacOS
│ ├── PyQt5.QtCore.so
│ ├── PyQt5.QtGui.so
│ ├── PyQt5.QtMultimedia.so
│ ├── PyQt5.QtMultimediaWidgets.so
│ ├── PyQt5.QtNetwork.so
│ ├── PyQt5.QtWidgets.so
│ ├── Python
│ ├── QtCore
│ ├── QtCore.so
│ ├── QtGui
│ ├── QtGui.so
│ ├── QtMultimedia
│ ├── QtMultimedia.so
│ ├── QtMultimediaWidgets
│ ├── QtMultimediaWidgets.so
│ ├── QtNetwork
│ ├── QtNetwork.so
│ ├── QtOpenGL
│ ├── QtWidgets
│ ├── QtWidgets.so
│ ├── _bisect.so
│ ├── _bz2.so
│ ├── _codecs_cn.so
│ ├── _codecs_hk.so
│ ├── _codecs_iso2022.so
│ ├── _codecs_jp.so
│ ├── _codecs_kr.so
│ ├── _codecs_tw.so
│ ├── _datetime.so
│ ├── _hashlib.so
│ ├── _heapq.so
│ ├── _json.so
│ ├── _lzma.so
│ ├── _md5.so
│ ├── _multibytecodec.so
│ ├── _opcode.so
│ ├── _pickle.so
│ ├── _posixsubprocess.so
│ ├── _random.so
│ ├── _scproxy.so
│ ├── _sha1.so
│ ├── _sha256.so
│ ├── _sha512.so
│ ├── _socket.so
│ ├── _ssl.so
│ ├── _struct.so
│ ├── array.so
│ ├── binascii.so
│ ├── grp.so
│ ├── imageformats
│ │ ├── libqdds.dylib
│ │ ├── libqgif.dylib
│ │ ├── libqicns.dylib
│ │ ├── libqico.dylib
│ │ ├── libqjp2.dylib
│ │ ├── libqjpeg.dylib
│ │ ├── libqmng.dylib
│ │ ├── libqsvg.dylib
│ │ ├── libqtga.dylib
│ │ ├── libqtiff.dylib
│ │ ├── libqwbmp.dylib
│ │ └── libqwebp.dylib
│ ├── libcrypto.1.0.0.dylib
│ ├── liblzma.5.dylib
│ ├── library.zip
│ ├── libreadline.6.dylib
│ ├── libssl.1.0.0.dylib
│ ├── main
│ ├── math.so
│ ├── platforms
│ │ ├── libqcocoa.dylib
│ │ ├── libqminimal.dylib
│ │ └── libqoffscreen.dylib
│ ├── pyexpat.so
│ ├── readline.so
│ ├── select.so
│ ├── sip.so
│ ├── termios.so
│ ├── time.so
│ ├── unicodedata.so
│ └── zlib.so
└── Resources
问题很明显:我做错了什么?(或者我没有做什么?)
libEGL.dll
添加到主应用程序目录中。那么在OS X上可能有类似的动态库吗? - Fenikso