please read all this post and help me.
i want to create --onefile
executable with pyinstaller.
i have these in Development side:
- windows 8.1 x64
- Qt 5.2.1
- Python 27
- PyQt5.2.1 (that built with Visual Studio 2012)
- Visual Studio 2012
- PyInstaller 2.1
- pyWin32
and these in Deployment side (VirtualBox) (as a clean VM):
- windows 8 x64
- vcredist_x64 2012
and this is my simple python program that i want to build:
#main.py
import sys
from PyQt5.QtWidgets import QApplication, QPushButton
app = QApplication(sys.argv)
win = QPushButton("Hello World!")
win.show()
sys.exit(app.exec_())
#------------------------------------------------
ok, when i build it as --onedir
(pyinstaller main.py
) it works fine on development side and deployment side.
when i build it as --onefile
(pyinstaller -F main.py
) it works fine on development side but it does not work on deployment side.
and give this error:
This application failed to start because it could not find or load the Qt platform plugin "windows".
Available platform plugins are: minimal, offscreen, windows.
Reinstalling the application may fix this problem.
what is my fault?or what is the problem of this building?
in terms of this error it can not find qt5_plugins
folder that is in _MEIxxxxx
folder in temp folder.
or,do you think problem is from sys
module?if yes, what should i do?
thanks for reply in advance
Update:
i should say that i have this warnnings and erro in build-time:
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
update2:
i added msvcp90.dll
, msvcm90.dll
to c:\Python27
manually, and this warnings and error is solved.
Update 3:
qt.conf:
[Paths]
Plugins = qt5_plugins
main.spec:
# -*- 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
)
qt5_plugins
that created automatically with pyinstaller
have platform plugin.and i don't think it needs to add manually as extralib.