[PySide] Nuitka issue on macOS

David Ching dc at dcsoft.com
Wed Feb 2 01:42:28 CET 2022


Hello, I am trying to use Nuitka to compile and distribute my Qt for Python
app.  https://doc.qt.io/qtforpython/deployment-nuitka.html cites a known
problem:  "Nuitka currently has a problem with the macOS bundle files on
current macOS versions. That has the effect that -standalone and -onefile
create a crashing application. Older versions which don't have the recent
macOS API changes from 2020 will work. We are currently trying to fix that
problem."  

I am using MacOS Monterey 12.1, Python 3.10 installed from python.org.  I am
not sure if the above means if I run Nuitka on an earlier MacOS version that
it will successfully build? 

I compiled the app using this command-line:

  python3 -m nuitka --follow-imports -standalone --enable-plugin=pyside6
mainscratch.py

Running the resulting app crashes my app referencing
QtQml.framework/Versions/A/QtQml:

Traceback (most recent call last):
  File "/Users/Ken/Desktop/QtScratch/mainscratch.dist/mainscratch.py", line
5, in <module>
ImportError:
dlopen(/Users/Ken/Desktop/QtScratch/mainscratch.dist/PySide6/QtCore.so,
0x0002): Library not loaded: @rpath/QtQml.framework/Versions/A/QtQml
  Referenced from:
/Users/Ken/Desktop/QtScratch/mainscratch.dist/libpyside6.abi3.6.2.dylib
  Reason: tried:
'/Users/Ken/Desktop/QtScratch/mainscratch.dist/Qt/lib/QtQml.framework/Versio
ns/A/QtQml' (no such file), '$ORIGIN/QtQml.framework/Versions/A/QtQml' (no
such file),
'/Users/Ken/Desktop/QtScratch/mainscratch.dist/PySide6/Qt/lib/QtQml.framewor
k/Versions/A/QtQml' (no such file),
'$ORIGIN/../QtQml.framework/Versions/A/QtQml' (no such file),
'/Users/Ken/Desktop/QtScratch/mainscratch.dist/PySide6/Qt/lib/QtQml.framewor
k/Versions/A/QtQml' (no such file),
'$ORIGIN/../QtQml.framework/Versions/A/QtQml' (no such file),
'$ORIGIN/QtQml.framework/Versions/A/QtQml' (no such file),
'$ORIGIN/QtQml.framework/Versions/A/QtQml' (no such file),
'/Library/Frameworks/QtQml.framework/Versions/A/QtQml' (no such file),
'/System/Library/Frameworks/QtQml.framework/Versions/A/QtQml' (no such file)

I do not use QML in my app, so could I workaround this?  How would I specify
not to include the QML module?  Or would there then be the same problem with
the remaining modules? 

Any fixes or workarounds would be helpful, as I think this problem has been
around for awhile and there is no sign of progress.  

Thanks,
David





More information about the PySide mailing list