Skip to content
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

OS X: binary installation with PIP includes incompatible "libXau.6.0.0.dylib" #7906

Closed
TurtleWilly opened this issue Mar 25, 2024 · 4 comments
Labels
Installation Usually a problem with … macOS

Comments

@TurtleWilly
Copy link

Installing anything that depends on PIL/pillow with PIP on an older Mac OS X/ OS X/ macOS (e.g. OS X Yosemite, 10.10.5) breaks, because the included pre-build "libXau.6.0.0.dylib" seems to be build without a compatibility fallback (aka needs a more recent version of the OS). I'm also not sure why this library is required at all on macOS, but that's just me wondering…

What did you do?

# prepare
$ cd /Volumes/Temporary/
$ python3.12 -m venv vcsitest
$ cd vcsitest/
$ source bin/activate

# install/use 'vcsi' as example case. Note: output reduced for clarity
(vcsitest) $ pip install vcsi
Collecting vcsi
  Using cached vcsi-7.0.16-py3-none-any.whl.metadata (16 kB)
…
Collecting pillow<11.0.0,>=10.0.0 (from vcsi)
  Using cached pillow-10.2.0-cp312-cp312-macosx_10_10_x86_64.whl.metadata (9.7 kB)
…
Installing collected packages: texttable, parsedatetime, pillow, numpy, MarkupSafe, jinja2, vcsi
Successfully installed MarkupSafe-2.1.5 jinja2-3.1.3 numpy-1.26.4 parsedatetime-2.6 pillow-10.2.0 texttable-1.7.0 vcsi-7.0.16

# try to run it
(vcsitest) $ bin/vcsi --version
Traceback (most recent call last):
  File "/Volumes/Temporary/vcsitest/bin/vcsi", line 5, in <module>
    from vcsi.vcsi import main
  File "/Volumes/Temporary/vcsitest/lib/python3.12/site-packages/vcsi/vcsi.py", line 33, in <module>
    from PIL import Image, ImageDraw, ImageFont
  File "/Volumes/Temporary/vcsitest/lib/python3.12/site-packages/PIL/Image.py", line 84, in <module>
    from . import _imaging as core
ImportError: dlopen(/Volumes/Temporary/vcsitest/lib/python3.12/site-packages/PIL/_imaging.cpython-312-darwin.so, 2): Library not loaded: @loader_path/libXau.6.0.0.dylib
  Referenced from: /Volumes/Temporary/vcsitest/lib/python3.12/site-packages/PIL/.dylibs/libxcb.1.1.0.dylib
  Reason: no suitable image found.  Did find:
	/Volumes/Temporary/vcsitest/lib/python3.12/site-packages/PIL/.dylibs/libXau.6.0.0.dylib: cannot load 'libXau.6.0.0.dylib' (load command 0x80000034 is unknown)
	/Volumes/Temporary/vcsitest/lib/python3.12/site-packages/PIL/.dylibs/libXau.6.0.0.dylib: cannot load 'libXau.6.0.0.dylib' (load command 0x80000034 is unknown)

What did you expect to happen?

Dylib loading to succeed. Application using pillow/PIL to run.

What actually happened?

Dylib failed to load, because of load command 0x80000034 is unknown (this load command is only supported by some way newer macOS version).

While I can't test/ verify this properly, I think all the other dylibs included in the package should work fine as they have the appropriate: LC_VERSION_MIN_MACOSX: version 10.10 (see otool -l <____>.dylib output):

$ cd /Volumes/Temporary/vcsitest/lib/python3.12/site-packages/PIL/.dylibs
# Note: output manually cleaned up for clarity here in the report
# Note: please note libXau missing the bits
$ for i in *.dylib; do echo -n "$i ->"; otool -l "$i" | fgrep ' version 10.'; done
libXau.6.0.0.dylib          ->
libbrotlicommon.1.1.0.dylib ->  version 10.10
libbrotlidec.1.1.0.dylib    ->  version 10.10
libfreetype.6.dylib         ->  version 10.10
libharfbuzz.0.dylib         ->  version 10.10
libjpeg.62.4.0.dylib        ->  version 10.10
liblcms2.2.dylib            ->  version 10.10
liblzma.5.dylib             ->  version 10.10
libopenjp2.2.5.0.dylib      ->  version 10.10
libpng16.16.dylib           ->  version 10.10
libsharpyuv.0.dylib         ->  version 10.10
libtiff.6.dylib             ->  version 10.10
libwebp.7.dylib             ->  version 10.10
libwebpdemux.2.dylib        ->  version 10.10
libwebpmux.3.dylib          ->  version 10.10
libxcb.1.1.0.dylib          ->  version 10.10
libz.1.3.dylib              ->  version 10.10

What are your OS, Python and Pillow versions?

  • OS: 10.10.5 (OS X Yosemite)
  • Python: 3.12.2
  • Pillow: 10.2.0 (binary/ pre-build release via PIP: pillow-10.2.0-cp312-cp312-macosx_10_10_x86_64)
@radarhere radarhere added macOS Installation Usually a problem with … labels Mar 25, 2024
@radarhere
Copy link
Member

Hi. Your problem has already been raised in #6862 (comment). #7764 should fix this for the next release of Pillow, due out in the next week.

If you would like to test the solution, try this - pillow-10.2.0-cp312-cp312-macosx_10_10_x86_64.whl.zip

@TurtleWilly
Copy link
Author

Awesome! Yes, this new build works for me.

(vcsitest) $ pip install /Volumes/Temporary/pillow-10.2.0-cp312-cp312-macosx_10_10_x86_64.whl --force-reinstall
(vcsitest) $ ./bin/vcsi --help
usage: vcsi [-h] [-o OUTPUT_PATH] [-c CONFIG] [--start-delay-percent START_DELAY_PERCENT]
            [--end-delay-percent END_DELAY_PERCENT] [--delay-percent DELAY_PERCENT]
            [--grid-spacing GRID_SPACING] [--grid-horizontal-spacing GRID_HORIZONTAL_SPACING]
            [--grid-vertical-spacing GRID_VERTICAL_SPACING] [-w VCS_WIDTH] [-g GRID] [-s NUM_SAMPLES]
            …
…

(vcsitest) $ otool -l lib/python3.12/site-packages/PIL/.dylibs/libXau.6.0.0.dylib
…
Load command 8
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.10
      sdk 13.1
…

👍

I'm looking forward to the release. 😎

@radarhere
Copy link
Member

Pillow 10.3.0 has been published to PyPI.

@TurtleWilly
Copy link
Author

Tested an installation of vcsi (including the updated pillow) via pip inside a fresh venv. Works. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Installation Usually a problem with … macOS
Projects
None yet
Development

No branches or pull requests

2 participants