Reputation: 405
I used to build using PyInstaller and everything was working perfectly. I don't know what has changed. I had a pre-configured VM that I used to compile and now it doesn't work as expected.
When I build now, the GUI looks like GTK (very old looking GUI) for some reason.
I've made a VERY simple PyQt5 app and made a clean VM with Python 3.6.4, PyInstaller, PyQt5, and six.
I've tried on macOS 10.10, 10.13, Windows 10, Windows 10 VM.
I've tried --hidden-import=PyQt5
I've tried everything again using Python 3.6.3 and PyInstaller 3.3
I've tried everything again using Python 3.6.3 and PyInstaller dev
I'm running out of things to test.
Here is the simple PyQt5 app sample app: PROBLEM.zip
Here is the build output:
C:\Users\Admin\Desktop\PROBLEM>C:\Python\python -m PyInstaller --paths C:\Python\Lib\site-packages\PyQt5\Qt\bin --add-binary *.dll;. --clean --noupx --name "TEST" main.py
250 INFO: PyInstaller: 3.4.dev0+1652c1968
265 INFO: Python: 3.6.4
265 INFO: Platform: Windows-10-10.0.16299-SP0
265 INFO: wrote C:\Users\Admin\Desktop\PROBLEM\TEST.spec
265 INFO: UPX is not available.
265 INFO: Removing temporary files and cleaning cache in C:\Users\Admin\AppData\Roaming\pyinstaller
296 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Admin\\Desktop\\PROBLEM',
'C:\\Python\\Lib\\site-packages\\PyQt5\\Qt\\bin',
'C:\\Users\\Admin\\Desktop\\PROBLEM']
296 INFO: checking Analysis
312 INFO: Building Analysis because out00-Analysis.toc is non existent
312 INFO: Initializing module dependency graph...
312 INFO: Initializing module graph hooks...
312 INFO: Analyzing base_library.zip ...
3421 INFO: running Analysis out00-Analysis.toc
3437 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by C:\Python\python.exe
3609 INFO: Caching module hooks...
3609 INFO: Analyzing C:\Users\Admin\Desktop\PROBLEM\main.py
3640 INFO: Loading module hooks...
3640 INFO: Loading module hook "hook-encodings.py"...
3718 INFO: Loading module hook "hook-pydoc.py"...
3718 INFO: Loading module hook "hook-PyQt5.py"...
3718 INFO: Loading module hook "hook-PyQt5.Qt.py"...
3718 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
3782 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
4125 INFO: Loading module hook "hook-PyQt5.QtPrintSupport.py"...
4171 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
4187 INFO: Loading module hook "hook-xml.py"...
4422 INFO: Looking for ctypes DLLs
4437 INFO: Analyzing run-time hooks ...
4437 INFO: Including run-time hook 'pyi_rth_qt5.py'
4437 INFO: Looking for dynamic libraries
5187 INFO: Looking for eggs
5187 INFO: Using Python library C:\Python\python36.dll
5187 INFO: Found binding redirects:
[]
5203 INFO: Warnings written to C:\Users\Admin\Desktop\PROBLEM\build\TEST\warnTEST.txt
5250 INFO: Graph cross-reference written to C:\Users\Admin\Desktop\PROBLEM\build\TEST\xref-TEST.html
5281 INFO: Appending 'binaries' from .spec
5328 INFO: checking PYZ
5328 INFO: Building PYZ because out00-PYZ.toc is non existent
5328 INFO: Building PYZ (ZlibArchive) C:\Users\Admin\Desktop\PROBLEM\build\TEST\out00-PYZ.pyz
5890 INFO: Building PYZ (ZlibArchive) C:\Users\Admin\Desktop\PROBLEM\build\TEST\out00-PYZ.pyz completed successfully.
5906 INFO: checking PKG
5906 INFO: Building PKG because out00-PKG.toc is non existent
5906 INFO: Building PKG (CArchive) out00-PKG.pkg
5937 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
5953 INFO: Bootloader C:\Python\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
5953 INFO: checking EXE
5953 INFO: Building EXE because out00-EXE.toc is non existent
5953 INFO: Building EXE from out00-EXE.toc
5953 INFO: Appending archive to EXE C:\Users\Admin\Desktop\PROBLEM\build\TEST\TEST.exe
5984 INFO: Building EXE from out00-EXE.toc completed successfully.
6000 INFO: checking COLLECT
6000 INFO: Building COLLECT because out00-COLLECT.toc is non existent
6000 INFO: Building COLLECT out00-COLLECT.toc
8703 INFO: Building COLLECT out00-COLLECT.toc completed successfully.
Any help is greatly appreciated.
Upvotes: 0
Views: 819
Reputation: 405
Currently PyInstaller 3.3.1 is not compatible with the latest version of PyQt5 (after version 5.9.2). They are working on a new PyInstaller hook for PyQt5.
If you are using Pyinstaller 3.3 or 3.3.1 then you have to use these versions of SIP and PyQt5 (order of installation matters).
On Windows:
sip-4.19.6-cp36-none-win32.whl
PyQt5-5.9.2-5.9.3-cp35.cp36.cp37-none-win32.whl
pyqt5_tools-5.9.0.1.2-cp36-none-win32.whl (if you need the PyQt designer)
On macOS:
sip-4.19.8-cp36-cp36m-macosx_10_6_intel.whl
PyQt5-5.9.2-5.9.3-cp35.cp36.cp37-abi3-macosx_10_6_intel.whl
Upvotes: 2