Python Forum
PySide2 with QtQuick & pyInstaller --> big executeable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PySide2 with QtQuick & pyInstaller --> big executeable
#4
Thanks for your answers.
Please do not confuse PySide2 with Qt5.

I found one solution: i explored the packed DLLs (debug&release) and recognized it was Qt5.12 although I installed PySide2 with Qt 5.12.1.
I researched a bit and found out that the DLLs came from a previously installed Qt-SDK(5.12) installed by me. Why that?:
  • PyInstaller uses a hook to resolve the QML dependencies hook-PySide2.QtQuick.py
  • this hook uses the PATH variable "QT5DIR" to find qmake.exe
  • qmake.exe is called with PATH variable "QT_INSTALL_QML" as argument
  • the call result points to the QML directory

Solution:
PySide2 doesnt include qmake.exe on its own (or i didnt found it) So a quick and dirty fix was to insert a hardcoded path into hook-PySide2.QtQuick.py which points to <pythoninstalldir>\Python37\Lib\site-packages\PySide2\qml

Result:
The resulting executable packed with PyInstaller is around 33MB. :)
Reply


Messages In This Thread
RE: PySide2 with QtQuick & pyInstaller --> big executeable - by mame - Mar-02-2019, 08:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PySide2 and QMediaPlayer menator01 19 7,055 Oct-11-2021, 05:26 PM
Last Post: menator01
  Tkinter vs Pyside2 twallace51 1 3,146 Apr-21-2019, 05:16 PM
Last Post: Larz60+
  Pyside2 darktitan 2 4,074 Aug-08-2018, 06:09 PM
Last Post: darktitan
  [PySide2][PyQt5] update QTableView cpuin 0 5,275 Mar-07-2018, 10:20 PM
Last Post: cpuin
  Problem on installing PySide2 on Mac cpuin 5 5,035 Feb-03-2018, 08:40 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020