question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PySide6 + Pillow for MacOS: Fatal Error problem with dependency scan

See original GitHub issue

I’m trying to use Nuitka to package the same application for multiple platforms. While it’s working flawless for Windows and Linux, on MacOS (on gh action runner) I get a Fatal error. To me, the log indicates that the combination of Pillow and PySide6 leads to some kind of conflict regarding liblzma.5.dylib, which both packages depend on.

Any ideas what I could try to solve this? Thanks a lot for this great project!

Environment:

  • Tried all Github Action Runner images: MacOS-10.15, MacOS-11 and MacOS-12
  • Python 3.10 (installed via actions/setup-python@2)
  • Related packages installed via poetry/pip:
    • Nuitka==0.8.4
    • PySide6-Essentials==6.3.0
    • Pillow==9.1.1

Nuitka call:

python -m nuitka \
   --standalone \
   --assume-yes-for-downloads \
   --macos-target-arch=x86_64 \
   --macos-create-app-bundle \
   --macos-disable-console \
   --macos-app-icon=/Users/runner/work/normcap/normcap/package/imgs/normcap.icns \
   --macos-signed-app-name=eu.dynobo.normcap  
   --macos-app-name=NormCap
   --macos-app-version=0.0.1 
   --enable-plugin=pyside6 
   --include-data-dir=/Users/runner/work/normcap/normcap/src/normcap/resources=resources
   --include-data-dir=/Users/runner/work/normcap/normcap/package/.cache=PySide6/qt-plugins/tls 
    /Users/runner/work/normcap/normcap/src/normcap/app.py

Log:

Nuitka-Options:INFO: Used command line options: --standalone --assume-yes-for-downloads --macos-target-arch=x86_64 --macos-create-app-bundle --macos-disable-console --macos-app-icon=/Users/runner/work/normcap/normcap/package/imgs/normcap.icns --macos-signed-app-name=eu.dynobo.normcap --macos-app-name=NormCap --macos-app-version=0.0.1 --enable-plugin=pyside6 --include-data-dir=/Users/runner/work/normcap/normcap/src/normcap/resources=resources --include-data-dir=/Users/runner/work/normcap/normcap/package/.cache=PySide6/qt-plugins/tls /Users/runner/work/normcap/normcap/src/normcap/app.py
Nuitka:INFO: Starting Python compilation with Nuitka '0.8.4' on Python '3.10' commercial None.
Nuitka-Plugins:INFO: pyside6: Injecting post-module load code for module 'PySide6.QtCore':
Nuitka-Plugins:INFO: pyside6:     Setting Qt library path to distribution folder. We need to avoid loading target
Nuitka-Plugins:INFO: pyside6:     system Qt plugins, which may be from another Qt version.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'PySide6.QtGui' added 'PySide6.QtCore,os,enum,shiboken6,shiboken6.Shiboken'.
Nuitka-Plugins:INFO: pyside6: Implicit dependencies of module 'PySide6.QtGui' added 'PySide6.QtCore'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'shiboken6' added 'argparse'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'PySide6.QtDBus' added 'PySide6.QtCore,enum,shiboken6,shiboken6.Shiboken'.
Nuitka-Plugins:INFO: pyside6: Implicit dependencies of module 'PySide6.QtDBus' added 'PySide6.QtCore'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'PySide6.QtNetwork' added 'PySide6.QtCore,enum,shiboken6,shiboken6.Shiboken'.
Nuitka-Plugins:INFO: pyside6: Implicit dependencies of module 'PySide6.QtNetwork' added 'PySide6.QtCore'.
Nuitka-Plugins:INFO: anti-bloat: Handling module 'PIL.ImageShow' with 1 change(s) for: remove IPython reference.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'PySide6.QtWidgets' added 'PySide6.QtCore,PySide6.QtGui,enum,shiboken6,shiboken6.Shiboken'.
Nuitka-Plugins:INFO: pyside6: Implicit dependencies of module 'PySide6.QtWidgets' added 'PySide6.QtGui'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'PySide6.QtCore' added 'os,enum,shiboken6,shiboken6.Shiboken'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'zipfile' added 'py_compile'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'urllib.request' added 'http.client,http.cookiejar'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'socket' added '_socket'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'shelve' added 'dbm.dumb'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'pathlib' added 'ntpath,posixpath'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'importlib.metadata' added 'email'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'ctypes' added '_ctypes'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module '_asyncio' added 'asyncio'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'encodings' added 'encodings.idna,encodings.base64_codec,encodings.hex_codec,encodings.rot_13'.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: clang (clang).
Nuitka:INFO: Downloading 'https://nuitka.net/ccache/v4.2.1/ccache-4.2.1.zip'.
Nuitka:INFO: Extracting to '/Users/runner/Library/Application Support/Nuitka/ccache/v4.2.1/ccache'
Nuitka-Scons:INFO: Backend linking program (no progress information available).
Nuitka-Scons:INFO: Compiled 87 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache miss': 86
Nuitka-Options:INFO: Included 17 data files due to specified data dir '/Users/runner/work/normcap/normcap/src/normcap/resources' on command line.
Nuitka-Options:INFO: Included data file 'PySide6/qt-plugins/tls/libqcertonlybackend.dylib' due to specified data dir '/Users/runner/work/normcap/normcap/package/.cache' on command line.
Nuitka-Options:INFO: Included data file 'PySide6/qt-plugins/tls/libqopensslbackend.dylib' due to specified data dir '/Users/runner/work/normcap/normcap/package/.cache' on command line.
Nuitka-Options:INFO: Included data file 'PySide6/qt-plugins/tls/libqsecuretransportbackend.dylib' due to specified data dir '/Users/runner/work/normcap/normcap/package/.cache' on command line.
Nuitka-Plugins:INFO: pyside6: Including Qt plugins 'iconengines,imageformats,platforms,styles' below 'PySide6/qt-plugins'.
Nuitka-Inclusion:WARNING: Ignoring non-identical DLLs for 'liblzma.5.dylib'. /Users/runner/Library/Caches/pypoetry/virtualenvs/normcap-IfoJSxBz-py3.10/lib/python3.10/site-packages/PIL/.dylibs/liblzma.5.dylib used by:    app.app/Contents/MacOS/PIL/_imaging.so different from /usr/local/opt/xz/lib/liblzma.5.dylib used by    app.app/Contents/MacOS/_lzma.so
FATAL: Error, problem with dependency scan of 'app.app/Contents/MacOS/_lzma.so' with '/usr/local/opt/xz/lib/liblzma.5.dylib' please report the bug.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Gianniecommented, Jun 19, 2022

I have struggled with this same issue. I have made some progress on it. I took some inspiration on handling of conflicting DLLs on windows to make this fork. Code is definitely messy and methods are not in the correct places, but I got past compilation errors, and I believe the runtime errors I’m getting now are unrelated, but I don’t know if you’ll experience the same runtime errors. Fork is:

https://github.com/Giannie/Nuitka/tree/copyclare

You can install my fork (after verifying diffs) to test with:

pip install -U --force-reinstall "https://github.com/Giannie/Nuitka/tree/copyclare"

Please do comment on changes I’ve made here. I’m happy to work towards a PR that may help, but at the moment this change is specific to our issue.

0reactions
kayhayencommented, Jul 30, 2022

This is part of 1.0 release, the macOS dependency scan got fully redone and won’t have these issues anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Can't install PIL after Mac OS X 10.9 - Stack Overflow
Works for me ( OS X Yosemite 10.10.2 - Python 2.7.9 ) : ... I had a similar problem: Installing pillow failed with...
Read more >
PyInstaller Documentation - Read the Docs
PyInstaller bundles a Python application and all its dependencies into a single package. ... Scan the list of open issues and pick some...
Read more >
Out of bounds write in Pillow - Vulners
An issue was discovered in Pillow before 8.1.1. TiffDecode has a heap-based buffer overflow when decoding crafted YCbCr files because of certain ...
Read more >
CHANGES.rst · 40e7ff622669550733b26f14dc817fb72e096250 ...
ElementTree #5565 [radarhere]; Moved CVE image to pillow-depends #5561 [radarhere] ... Fix "Fatal Python error: UNREF invalid object" in debug builds #1936 ...
Read more >
How to Install Pillow on MacOS? - GeeksforGeeks
Step 3: Upgrade your pip to avoid errors during installation. pip3 install --upgrade pip. upgrading pip in macos. Step 4: Enter the following ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found