Closed niekvandepas closed 1 month ago
Can you try pip install -U pip
then try again? Seems like pip should be choosing one of the arm64
wheels here: https://pypi.org/project/pillow/10.3.0/#files but instead it's falling back to compilation, which then fails.
Thanks for checking in.
> pip install -U pip
Requirement already satisfied: pip in /Users/niekvdpas/.pyenv/versions/3.10.14/lib/python3.10/site-packages (24.0)
> pip install pillow
[same result]
No luck unfortunately.
Trying to install the arm64 wheel manually gives me the following error:
> python3 -m pip install ./pillow-10.3.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl
ERROR: pillow-10.3.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl is not a supported wheel on this platform.
EDIT: same goes for attempting to install the arm64 CPython wheel:
> python3 --version
Python 3.10.14
> python3 -m pip install ./pillow-10.3.0-cp310-cp310-macosx_11_0_arm64.whl
ERROR: pillow-10.3.0-cp310-cp310-macosx_11_0_arm64.whl is not a supported wheel on this platform.
Please could you try reinstalling with -vv
for extra debug output? It will tell us which wheels it attempted and why it skipped them.
And also run pip debug --verbose
to show your compatible tags.
And what does python --version --version
say?
Output of python --version --version
:
Python 3.10.14 (main, Apr 25 2024, 10:24:02) [Clang 12.0.1 ]
https://github.com/python-pillow/Pillow/issues/6725 was a previous post with the same initial error. That user's guess about what happened was that there was a
misformed dependency tree in homebrew. Maybe related to llvm installed through homebrew which broke z3 lib for clang
Their solution was to
reinstalled xcode, python (via brew), pyenv and finally was able to get Pillow installed
I'm not saying you need to do anything so drastic, but it's something to think about at least.
For a slightly odd idea, since pip debug --verbose
lists "cp310-cp310-macosx_10_16_arm64", and 10.16 and 11.0 are the same thing, you could download pillow-10.3.0-cp310-cp310-macosx_11_0_arm64.whl, rename it to pillow-10.3.0-cp310-cp310-macosx_10_16_arm64.whl, and try installing that.
https://github.com/pypa/pip/issues/11789 talks about a faliure to find macOS 11 wheels with Python 3.8, and the problem seems to be outdated packaging.
Could you pip install --upgrade packaging
and then try installing Pillow again?
Thanks for the help! The renaming trick worked :)
Upgrading packaging did not seem to do anything, unfortunately.
Hang on, I'm now getting an error when trying to import:
import pytesseract
from PIL import Image
Traceback (most recent call last):
File "/Users/niekvdpas/code/ocr.py", line 1, in <module>
import pytesseract
File "/Users/niekvdpas/.pyenv/versions/3.10.14/lib/python3.10/site-packages/pytesseract/__init__.py", line 2, in <module>
from .pytesseract import ALTONotSupported
File "/Users/niekvdpas/.pyenv/versions/3.10.14/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 27, in <module>
from PIL import Image
File "/Users/niekvdpas/.pyenv/versions/3.10.14/lib/python3.10/site-packages/PIL/Image.py", line 94, in <module>
from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/Users/niekvdpas/.pyenv/versions/3.10.14/lib/python3.10/site-packages/PIL/__init__.py)
Seems like the installation may not have been as succesful as it seemed
Given your multiple attempts at installation, could you pip uninstall Pillow
, make sure you can't import Pillow at all (if not, uninstall again), and then try installing from the renamed wheel again?
Ah, that fixed it! Thanks so much!
What did you do?
I ran
pip install Pillow
.What did you expect to happen?
I expected pip to install Pillow.
What actually happened?
I got a compilation error:
Digging through the clang output, I mostly see a bunch of warnings (not errors) of the form
warning: unknown platform 'visionos' in availability macro [-Wavailability]
. I tried to grep forerr
orfatal
but couldn't find anything in the output, which I've uploaded as a Gist here.Command-line tools for macOS are installed properly, and I'm able to build other Pip packages.
What are your OS, Python and Pillow versions?
macOS Sonoma 14.3.1
Python 3.9.19
(I've tried using3.10
as well)