Skip to content

Image import fails on macOS 10.13 with Pillow 9.1.0 #6179

Closed
python-pillow/pillow-wheels
#282

Description

@AlphonsG

What did you do?

Tried running from PIL import Image after installing Pillow from pip.

What did you expect to happen?

Import to work.

What actually happened?

Error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/alphons/.venv/rainbow-env/lib/python3.8/site-packages/PIL/Image.py", line 132, in <module>
    from . import _imaging as core
ImportError: dlopen(/Users/alphons/.venv/rainbow-env/lib/python3.8/site-packages/PIL/_imaging.cpython-38-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /Users/alphons/.venv/rainbow-env/lib/python3.8/site-packages/PIL/.dylibs/libtiff.5.dylib (which was built for Mac OS X 11.0)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/alphons/.venv/rainbow-env/lib/python3.8/site-packages/PIL/.dylibs/libtiff.5.dylib

What are your OS, Python and Pillow versions?

  • OS: macOS 10.13 High Sierra (64 bit)
  • Python: 3.8.10
  • Pillow: 9.1.0

Note: import works using Pillow 9.0.1

Activity

  1. added
    Installation
    on Apr 4, 2022
  2. radarhere commented on Apr 4, 2022

    @radarhere
    Member

    Hi. We've changed a few settings in our wheels since January, so this could be a number of different things. I've put together a Pillow 9.1.0 wheel for your system the way we did it for Pillow 9.0.1 - Pillow-9.1.0-cp38-cp38-macosx_10_10_x86_64.whl.zip. Would you be able to test it and see if that works?

    If it does work, would you be willing to test out some more variations on that wheel, so that we can figure out exactly what the problem is? macOS 10.13 is not a system that I have easy access to.

    If that doesn't work, and you're looking for things to try immediately, you can install Pillow from source - python3 -m pip install Pillow --no-binary :all:

  3. hugovk commented on Apr 4, 2022

    @hugovk
    Member

    Note that macOS 10.13 (High Sierra) is now 16 months EOL and two versions out of support, so strictly speaking not supported by Pillow.

    I also recommend upgrading to macOS 10.15 (Catalina) or later to get security updates from Apple.

    image

  4. AlphonsG commented on Apr 4, 2022

    @AlphonsG
    Author

    Hello @radarhere

    I've put together a Pillow 9.1.0 wheel for your system the way we did it for Pillow 9.0.1 - Pillow-9.1.0-cp38-cp38-macosx_10_10_x86_64.whl.zip. Would you be able to test it and see if that works?

    Yeah that worked:

    2022-04-04 17_31_28-Greenshot capture form

    If it does work, would you be willing to test out some more variations on that wheel, so that we can figure out exactly what the problem is?

    Yeah I can do that

  5. radarhere commented on Apr 4, 2022

    @radarhere
    Member
  6. AlphonsG commented on Apr 5, 2022

    @AlphonsG
    Author
    1. before_auditwheel.zip

    Worked

    1. after_auditwheel.zip

    Worked

    1. before_turbo.zip

    Failed, with previous error.

    1. after_turbo.zip

    Failed, with previous error.

    Also, just a note, the name of files 1 and 2 after download is the same, didn't check if the files themselves are different or not though.

  7. radarhere commented on Apr 5, 2022

    @radarhere
    Member

    Ah, ok. I've got it now. The problem was python-pillow/pillow-wheels#265, and I've created python-pillow/pillow-wheels#282 to fix this for the next release.

    This wheel works, yes? Pillow-9.1.0-cp38-cp38-macosx_10_10_x86_64.whl.zip

  8. AlphonsG commented on Apr 5, 2022

    @AlphonsG
    Author

    This wheel works, yes? Pillow-9.1.0-cp38-cp38-macosx_10_10_x86_64.whl.zip

    Yes that wheel works, thanks very much for fixing!

  9. wulph111 commented on Apr 7, 2022

    @wulph111

    you can install Pillow from source - python3 -m pip install Pillow --no-binary :all:

    Installing from source worked for me. Thanks for looking into this, even though official support ended. Not everyone wants to update their systems, for various reasons. I always appreciate a path to keep legacy stuff working.

  10. radarhere commented on Apr 8, 2022

    @radarhere
    Member
  11. jfbu commented on Jan 3, 2023

    @jfbu

    A similar problem happens with 9.4.0 on my mac osx high sierra

    $ python
    Python 3.10.9 (v3.10.9:1dd9be6584, Dec  6 2022, 14:37:36) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from PIL import Image
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/path/to/.venv310/lib/python3.10/site-packages/PIL/Image.py", line 103, in <module>
        from . import _imaging as core
    ImportError: dlopen(/Users/path/to/.venv310/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so, 2): Library not loaded: @loader_path/libXdmcp.6.dylib
      Referenced from: /Users/path/to/.venv310/lib/python3.10/site-packages/PIL/.dylibs/libxcb.1.1.0.dylib
      Reason: no suitable image found.  Did find:
    	/Users/path/to/.venv310/lib/python3.10/site-packages/PIL/.dylibs/libXdmcp.6.dylib: cannot load 'libXdmcp.6.dylib' (load command 0x80000034 is unknown)
    	/Users/path/to/.venv310/lib/python3.10/site-packages/PIL/.dylibs/libXdmcp.6.dylib: cannot load 'libXdmcp.6.dylib' (load command 0x80000034 is unknown)
    >>> ^D

    No problem with 9.3.0. Not opening a new ticket as my mac os x is 10.13.6 (high sierra). Building from source did not work for me, clang (14.0.3) raised errors about 'TARGET_OS_EMBEDDED' is not defined, the Xcode 10.1 is latest compatible with my mac osx high sierra.

  12. radarhere commented on Jan 3, 2023

    @radarhere
    Member

    Hi. You're having the same problem as #3068 (comment)

    I suspect the change between Pillow 9.3.0 and 9.4.0 was because python-pillow/pillow-wheels#350 updated libXau to 1.0.11. Homebrew removed support for 10.15 when making that update - Homebrew/homebrew-core@712726c

    If you would like to confirm my theory, you can test the wheels from https://github.com/radarhere/pillow-wheels/actions/runs/3825868768 - https://github.com/radarhere/pillow-wheels/suites/10148738168/artifacts/495813662. They are Pillow 9.4.0, but with libXau 1.0.10. If they work for you, then I'm right.

  13. radarhere commented on Jan 3, 2023

    @radarhere
    Member

    More specifically, you can python3 -m pip install Pillow-9.4.0-cp310-cp310-macosx_10_10_x86_64.whl with
    Pillow-9.4.0-cp310-cp310-macosx_10_10_x86_64.whl.zip

  14. jfbu commented on Jan 3, 2023

    @jfbu

    More specifically, you can python3 -m pip install Pillow-9.4.0-cp310-cp310-macosx_10_10_x86_64.whl with
    Pillow-9.4.0-cp310-cp310-macosx_10_10_x86_64.whl.zip

    Hi, yes confirmed it works for me!

  15. radarhere commented on Jan 4, 2023

    @radarhere
    Member

    Thanks. I've created python-pillow/pillow-wheels#357 as a possible solution to this.

  16. radarhere commented on Jan 5, 2023

    @radarhere
    Member
  17. radarhere commented on Jan 6, 2023

    @radarhere
    Member

    I've uploaded new Pillow 9.4.0 wheels. Installation should now work.

  18. klarich commented on Aug 10, 2023

    @klarich

    python3 -m pip install Pillow-9.4.0-cp310-cp310-macosx_10_10_x86_64.whl

    This worked for me!

  19. radarhere commented on Aug 10, 2023

    @radarhere
    Member

    Hi. We've released new wheels since, so you shouldn't still be having a problem with regular python3 -m pip install Pillow. If you'd like to open a new issue about it, we can have a discussion to try and figure out what is going on.

  20. klarich commented on Aug 10, 2023

    @klarich

    I think this is because Pillow is being installed by another library via conda and that library is installing an older version (9.4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    InstallationmacOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions