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

Hooks: Update PyQt5 hooks #3439

Merged
merged 13 commits into from Apr 9, 2018

Conversation

Projects
None yet
4 participants
@bjones1
Member

bjones1 commented Apr 2, 2018

This PR is a cleaned-up version of #3233. It provides improved support for PyQt5 applications.

@bjones1 bjones1 requested a review from htgoebel Apr 2, 2018

@bjones1 bjones1 referenced this pull request Apr 2, 2018

Closed

PyQt5 fix #3233

@tallforasmurf

This comment has been minimized.

Contributor

tallforasmurf commented Apr 2, 2018

just fyi I gave it a run with the infamous minweb and it still fails as before, failing to find /qtwebengine_locales. (Well, it might've gotten fixed inadvertently...) So I recommend ignoring that for the time being, and after this PR is accepted into the mainline I will open a new issue for that specific problem, with the requisite simple test case etc.

@bjones1

This comment has been minimized.

Member

bjones1 commented Apr 3, 2018

@tallforasmurf, sounds good. I'm happy to make changes, but as you say after we get the main fix merged.

@Siecje

This comment has been minimized.

Contributor

Siecje commented Apr 3, 2018

I just installed the pyqt5_fix_cleaned branch from your repo and I get the same error that I mentioned before. #3233 (comment)

I'm using Windows 7 32 bit with Python 3.4.

This happens when I run pyinstaller myfile.spec.

@bjones1

This comment has been minimized.

Member

bjones1 commented Apr 4, 2018

@Siecje, I assume this doesn't happen with #3233? If so, the primary difference between them is the rebase. I'd guess the problem would be in the commits between these two -- do you know how to run a git bisect?

@Siecje

This comment has been minimized.

Contributor

Siecje commented Apr 4, 2018

I don't even have git on that build computer. I will try to download the zip of the pyqt5_fix branch from your repo and see if it works.

@Siecje

This comment has been minimized.

Contributor

Siecje commented Apr 5, 2018

I have two questions about this PR, but first some background.

Background

I have not been able to package a PyQt5 QML application. This is the application I am testing https://github.com/Siecje/qml-testing/blob/PyInstaller/main.spec

I am on Windows 7 32-bit with Python 3.4.4.

I installed pywin32 using the wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32
I have installed the latest PyInstaller from PyPI and the develop branch.

I have compiled PyQt5 from source (there is no wheel for Python 3.4).

In order for the application to work on another computer I have to set two environment variables.

set QT_QPA_PLATFORM_PLUGIN_PATH=%INSTALL_DIR%\PyQt5\Qt\plugins\platforms
set QML2_IMPORT_PATH=%INSTALL_DIR%\qml

Without QT_QPA_PLATFORM_PLUGIN_PATH I get this error:

This application failed to start because it could not find or load the Qt platform plugin "windows"
in "".

Questions

1

The current version of PyInstaller puts the .qml files into a qml\ directory at the same level as the .exe.

This PR is setting it to a different directory.
https://github.com/pyinstaller/pyinstaller/pull/3439/files#diff-948183de8808f1b61c7bedc645642203R18

I assume it is different because it is from a PyQt5 install from source.

Is this difference also fixed in this PR?

2

This PR is not setting QT_QPA_PLATFORM_PLUGIN_PATH. I tried setting QT_PLUGIN_PATH instead but it did not work for me.

Should QT_QPA_PLATFORM_PLUGIN_PATH be added?

@htgoebel

This comment has been minimized.

Member

htgoebel commented Apr 8, 2018

@bjones1 Is there really a need for me to review again? If you addressed all my comments (or decided not to do), this should be fine.

Except of some severe errors pylint reports (see https://travis-ci.org/pyinstaller/pyinstaller/jobs/361343548 and https://travis-ci.org/pyinstaller/pyinstaller/jobs/361343549): some syntax errors and some very long lines. (No need to address all the lint-errors, esp. if the code would become less readable when following them :-)

If you handled the pylint, this is fine for me. Since you said, I'd like to rebase, I suggest merging with --no-ff -m "Hooks: Merge PyQt5 fixes". This will group these merges . Thanks.

@bjones1 bjones1 force-pushed the bjones1:pyqt5_fix_cleaned branch from e725443 to 314ebe2 Apr 9, 2018

@bjones1

This comment has been minimized.

Member

bjones1 commented Apr 9, 2018

@htgoebel, thanks. All fixes are now included and long lines wrapped where possible. I'll merge/rebase in some nice way when the tests pass.

@bjones1 bjones1 force-pushed the bjones1:pyqt5_fix_cleaned branch 2 times, most recently from b103daf to ef59942 Apr 9, 2018

@bjones1 bjones1 force-pushed the bjones1:pyqt5_fix_cleaned branch from ef59942 to 97b39e4 Apr 9, 2018

@bjones1 bjones1 merged commit 6b2fbcc into pyinstaller:develop Apr 9, 2018

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details

@bjones1 bjones1 deleted the bjones1:pyqt5_fix_cleaned branch May 25, 2018

melvyn2 added a commit to melvyn2/ThatChat that referenced this pull request Jun 1, 2018

@htgoebel htgoebel added this to the PyInstaller 3.4 milestone Sep 2, 2018

The-Compiler added a commit to The-Compiler/pyinstaller that referenced this pull request Sep 22, 2018

Only add NSS subdir path if it exists
On Archlinux, the NSS package ships with /usr/lib/libnss3.so.

The auto detection works fine with that, but the fix from pyinstaller#3439 breaks it again
since no /usr/lib/nss/libnss3.so exists:

    INFO: Loading module hook "hook-PyQt5.QtWebEngineWidgets.py"...
    Unable to find "/usr/lib/nss/*.so" when adding binary and data files.

Thus, it should only be added on distributions where it's really necessary.
With this change, test_PyQt5_QWebEngine works on Archlinux (it failed before).

The-Compiler added a commit to The-Compiler/pyinstaller that referenced this pull request Sep 23, 2018

Hooks: Only add NSS subdir path for QtWebEngine if it exists
On Archlinux, the NSS package ships with /usr/lib/libnss3.so.

The auto detection works fine with that, but the fix from pyinstaller#3439 breaks it again
since no /usr/lib/nss/libnss3.so exists:

    INFO: Loading module hook "hook-PyQt5.QtWebEngineWidgets.py"...
    Unable to find "/usr/lib/nss/*.so" when adding binary and data files.

Thus, it should only be added on distributions where it's really necessary.
With this change, test_PyQt5_QWebEngine works on Archlinux (it failed before).

The-Compiler added a commit to The-Compiler/pyinstaller that referenced this pull request Sep 23, 2018

Hooks: Only add NSS subdir path for QtWebEngine if it exists.
On Archlinux, the NSS package ships with /usr/lib/libnss3.so.

The auto detection works fine with that, but the fix from pyinstaller#3439 breaks it again
since no /usr/lib/nss/libnss3.so exists:

    INFO: Loading module hook "hook-PyQt5.QtWebEngineWidgets.py"...
    Unable to find "/usr/lib/nss/*.so" when adding binary and data files.

Thus, it should only be added on distributions where it's really necessary.
With this change, test_PyQt5_QWebEngine works on Archlinux (it failed before).

bjones1 added a commit that referenced this pull request Sep 23, 2018

Hooks: Only add NSS subdir path for QtWebEngine if it exists.
On Archlinux, the NSS package ships with /usr/lib/libnss3.so.

The auto detection works fine with that, but the fix from #3439 breaks it again
since no /usr/lib/nss/libnss3.so exists:

    INFO: Loading module hook "hook-PyQt5.QtWebEngineWidgets.py"...
    Unable to find "/usr/lib/nss/*.so" when adding binary and data files.

Thus, it should only be added on distributions where it's really necessary.
With this change, test_PyQt5_QWebEngine works on Archlinux (it failed before).

mkassner added a commit to pupil-labs/pyinstaller that referenced this pull request Nov 5, 2018

Hooks: Only add NSS subdir path for QtWebEngine if it exists.
On Archlinux, the NSS package ships with /usr/lib/libnss3.so.

The auto detection works fine with that, but the fix from pyinstaller#3439 breaks it again
since no /usr/lib/nss/libnss3.so exists:

    INFO: Loading module hook "hook-PyQt5.QtWebEngineWidgets.py"...
    Unable to find "/usr/lib/nss/*.so" when adding binary and data files.

Thus, it should only be added on distributions where it's really necessary.
With this change, test_PyQt5_QWebEngine works on Archlinux (it failed before).

cowo78 pushed a commit to cowo78/pyinstaller that referenced this pull request Dec 10, 2018

Hooks: Only add NSS subdir path for QtWebEngine if it exists.
On Archlinux, the NSS package ships with /usr/lib/libnss3.so.

The auto detection works fine with that, but the fix from pyinstaller#3439 breaks it again
since no /usr/lib/nss/libnss3.so exists:

    INFO: Loading module hook "hook-PyQt5.QtWebEngineWidgets.py"...
    Unable to find "/usr/lib/nss/*.so" when adding binary and data files.

Thus, it should only be added on distributions where it's really necessary.
With this change, test_PyQt5_QWebEngine works on Archlinux (it failed before).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment