title: Bundle (Just --onefile)
body: <p>please read all this post and help me.</p>
  
  <p>i want to create <code>--onefile</code> executable with pyinstaller.</p>
  
  <p>i have these in Development side:</p>
  
  <ul>
  <li>windows 8.1 x64</li>
  <li>Qt 5.2.1</li>
  <li>Python 27</li>
  <li>PyQt5.2.1 (that built with Visual Studio 2012)</li>
  <li>Visual Studio 2012</li>
  <li>PyInstaller 2.1</li>
  <li>pyWin32</li>
  </ul>
  
  <p>and these in Deployment side (VirtualBox) (as a clean VM):</p>
  
  <ul>
  <li>windows 8 x64</li>
  <li>vcredist_x64 2012</li>
  </ul>
  
  <p>and this is my simple python program that i want to build:</p>
  
  <pre><code>#main.py
  import sys
  from PyQt5.QtWidgets import QApplication, QPushButton
  
  app = QApplication(sys.argv)
  
  win = QPushButton("Hello World!")
  win.show()
  
  sys.exit(app.exec_())
  #------------------------------------------------
  </code></pre>
  
  <p>ok, when i build it as <code>--onedir</code> (<code>pyinstaller main.py</code>) it works fine on development side and deployment side.</p>
  
  <p>when i build it as <code>--onefile</code> (<code>pyinstaller -F main.py</code>) it works fine on development side but it does not work on deployment side.</p>
  
  <p>and give this error:</p>
  
  <blockquote>
    <p>This application failed to start because it could not find or load the
    Qt platform plugin "windows".</p>
    
    <p>Available platform plugins are: minimal, offscreen, windows.</p>
    
    <p>Reinstalling the application may fix this problem.</p>
  </blockquote>
  
  <p>what is my fault?or what is the problem of this building?</p>
  
  <p>in terms of this error it can not find <code>qt5_plugins</code> folder that is in <code>_MEIxxxxx</code> folder in temp folder.</p>
  
  <p>or,do you think problem is from <code>sys</code> module?if yes, what should i do?</p>
  
  <p>thanks for reply in advance</p>
  
  <p><strong>Update:</strong></p>
  
  <p>i should say that i have this warnnings and erro in build-time:</p>
  
  <blockquote>
    <p>1024 WARNING: No such file C:\Python27\msvcp90.dll 1024 WARNING:
    Assembly incomplete 1026 ERROR: Assembly
    amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none not found</p>
  </blockquote>
  
  <p><strong>update2:</strong></p>
  
  <p>i added <code>msvcp90.dll</code>, <code>msvcm90.dll</code> to <code>c:\Python27</code> manually, and this warnings and error is solved.</p>
  
  <p><strong>Update 3:</strong></p>
  
  <p><em>qt.conf:</em></p>
  
  <pre><code>[Paths]
  Plugins = qt5_plugins
  </code></pre>
  
  <p><em>main.spec:</em></p>
  
  <pre><code># -*- mode: python -*-
  a = Analysis(['main.py'],
               pathex=['D:\\hello2'],
               hiddenimports=['sip', "PyQt5.QtCore", "PyQt5.QtGui", "PyQt5.QtWidgets"],
               hookspath=None,
               runtime_hooks=None)
  pyz = PYZ(a.pure)
  plugins = [("qt5_plugins/platforms/qwindows.dll",
               "C:\\Qt\\Qt5.2.1\\5.2.1\\msvc2012_64\\plugins\\platforms\\qwindows.dll", "BINARY")]
  data = [
    ("qt.conf", "qt.conf", "DATA")
  ]
  exe = EXE(
      pyz,
      a.scripts,
      a.binaries + plugins,
      a.zipfiles,
      a.datas + data,
      name='main.exe',
      debug=False,
      strip=None,
      upx=True,
      console=True
  )
  </code></pre>
  
  <p><code>qt5_plugins</code> that created automatically with <code>pyinstaller</code> have platform plugin.and i don't think it needs to add manually as extralib.</p>