Error:
This application failed to start because it could not find or load the Qt platform plugin "windows" in "C:\Users\jsmith\AppData\Local\Temp_MEI23522\qt5_plugins\platforms".
Reinstalling the application may fix this problem.
My PyInstaller spec:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['test.py'],
pathex=['C:\\Users\\admin\\compile'],
binaries=[],
datas=[],
hiddenimports=[],
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,
a.binaries,
a.zipfiles,
a.datas,
name='test',
debug=False,
strip=False,
upx=False,
runtime_tmpdir=None,
console=False , icon='icon.ico')
So I ran into this problem while compiling my PyQt5 5.8.2 (with Python 3.6.1) program with the latest version of PyInstaller with pip
, and, it works fine! The one-file executable works on the computer that compiled it.
But when I test it on another computer or virtual machine that doesn't have everything set up already, then, it crashes on start with this error:
could not find or load the Qt platform plugin 'windows'
So here's what I have found so far. Since I set the platform plugin path environment variable in the code, it has the path (C:\Users\jsmith\AppData\Local\Temp\_MEI23522\qt5_plugins\platforms
), and I know for a fact the qwindows.dll
is in there because I was able to access it through the path before the folder was automatically deleted (since it's in temp
) (I've also done onedir
before just to make sure it was there, it was). So does that mean it sees it but is unable to load it, or is it something else I'm missing?
Also, UPX
is disabled and isn't even on my computer, so that isn't the problem.
By the way, this is not a duplicate. I have already looked on SO for similar questions and all of them were either for a different type of application or the solutions were for a different type of problem. I have looked everywhere for days and haven't found the solution.
Please guide me. Thanks.