New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple PyQt5 GUI Looks Like GTK When Compiling with PyInstaller on macOS and Windows #3417
Comments
Here is the simple PyQt5 app: main.py:
And I compile it using the command below:
|
Looks like some files are not packages, e.g. icons, themes, etc. Please look at the https://github.com/pyinstaller/pyinstaller/wiki/Recipes or search the open and closed issue about the gui system you are using. And please have a look at Make sure everything is packaged correctly for tips to find out what is missing. |
Further you may search for some Qt theming guide. |
My build process has not changed at all. The only things that have changed since it was working are:
I just tried installing everything again on a clean VM with the latest version of Python and PyInstaller but old version of PyQt5 and it works! So something has changed in the new version of PyQt5 (after version 5.9.2). I want to debug this for your guys but I don't know how to compare the two versions of PyQt5. Any suggestions? |
I confirm that the pyqt5_fix works. Use this dev version of PyInstaller if you must use the latest version of PyQt5:
Or install the latest stable version of PyInstaller (currently 3.3.1) and old versions of SIP and PyQt5 until the dev version of PyInstaller is merged with the main branch. On Windows:
On macOS:
|
Just wanted to confirm that I upgraded from
to
For those that stumble upon this. "Very old GUI" (on MAC) means this: Instead it should look like this: |
Should this be fixed in 3.4? I've just hit this issue on macOS with PyQt5 5.11.3 and PyQt5-sip 4.19.13. Downgrading to PyQt5 5.9.2 did not help. Apps look like ran on X11 server (no font anti-aliasing). Please help. |
@mpasternak Try it out |
Looks like I expressed myself in an incorrect way, sorry for confusion. I tried it with PyInstaller 3.4 and PyQt5 5.9.2 and 5.11.3 . App looks bad. |
@mpasternak, please provide a short example and I'll take a look. |
Not exactly a short example, but the repo is here: http://github.com/mpasternak/pfreader-gui ; I've just re-added app.spec there. Here's the log and here is the PNG file with screenshot. macOS Mojave 10.14.1 . packages.txt contains list of all packages in my venv. |
Provide me a short single-file source, post it here, and I'll be happy to built it on my PC (Windows). I don't want to download your git files. |
@bjones1 , the problem occurs on macOS. |
Oops, sorry -- I misread the issue. I can't help here, since I don't own a Mac. Patches/fixes welcome. I'm guessing some needed PyQt5 files aren't copied -- if you can figure out what these are, that would help. |
@bjones1 no need to sorry, I'm grateful for your time, thank you. There must be some files omitted because the app generated is 23 MB as opposed to the one generated with py2app (240 MB). On the other hand, albeit small, albeit no font aliasing, it seems to work. I'm going to use py2app for now, but if anyone has any hints for pyinstaller, I'll be no less grateful. Thanks! |
@mpasternak The original issue was for windows. Please be more careful when posting comments, as such mistakes cost the rare spare time of us volunteers. Thanks. |
And the solution for windows does not seem to be added to this conversation so I am adding it now:
Add as many of those plugins as you need but in particular here you need the styles one, which has the windowsvista style that looks significantly better than the other 2. |
These files should already be copied by current PyInstaller. |
I can assure you it does not get copied by 3.6 All the hooks are running and they miss all these dlls and everything. UPDATE: So it seems that if you install PyQt5 from pip it is a very different layout in the venv from the one in a conda package. This fix relates to Anaconda which some of us has to suffer through... not my fav build system but the company I work for uses that. The difference seems to be that in a pip package in a standard venv it is stored here:
which looks good to me In an Anaconda env it is here:
while the rest of the PyQt5 package sits in
which I wholeheartedly agree is batshit crazy :D PyInstaller may or may not claim to support it but since there is an virtual env however it may be layed out and the import works and functions then I would expect PyInstaller to find things. This may or may not be a bug depending how you look at it but it would warrant a warning maybe because I wasted a lot of time figuring this shit out :D |
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:
Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: