title: This application failed to start because it could not find or load the Qt platform plugin "cocoa"
body: <p>I think I did everything I could in the last 20 hours, but nothing seems to work. My app is running and working -- just as it should -- the only problem I have is that I cannot create a <code>.app</code> bundle from it. I tried both <code>Py2App</code> and <code>cx_Freeze</code> but non of them is working. Because of the multi-platform support I would stick with the latter -- if possible.</p>
  
  <p>The <code>setup.py</code> looks like this:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>The error message I have is this:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>My system Info:</p>
  
  <pre><code>Mac OS X  : 10.9.4
  Python    :  3.4.1
  cx_Freeze :  0.9
  PyQt5:    :  5.3.1
  - - -
  Packages installed via: Homebrew and PIP
  </code></pre>
  
  <p><code>.app</code> structure:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The question is I think pretty obvious: what am I doing wrong? (or what am I not doing?)</p>