0

EDIT: Please check the comment I wrote below

I am running macOS High Sierra 10.13.6 and I think I have downloaded a version for PIL library(using brew install py3cairo probably) that is not compatible with my OS. The computer has also pre-installed python2. I have installed ffmpeg and I have it stored in documents, with some help, I have placed it in path so when I type in terminal:

>>> echo $PATH

the output is: Users/imac/Documents/ffmpeg:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin

My terminal's output when I run a simple program that is supposed to work(copy-paste from tutorial for manim):

Traceback (most recent call last):
...(omitted)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/Image.py", line 132, in <module>
    from . import _imaging as core
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/_imaging.cpython-39-darwin.so, 
2): Symbol not found: ____chkstk_darwin
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/.dylibs/libtiff.5.dylib 
(which was built for Mac OS X 11.0)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/.dylibs/libtiff.5.dylib```
Anonymous
  • 61
  • 6
  • I think I found a relative topic here https://stackoverflow.com/questions/49969800/why-is-pip-installing-pillow-for-os-x-10-12-when-i-have-os-x-10-11-installed. I don't know if the answers apply to my case I have python3 and mac OS High Sierra 10.13.6. I suspect the 2nd answer may be more suitable but I still need guidance. Any help is appreciated, thank you! – Anonymous Apr 03 '22 at 18:29
  • Did you try any of those answers? – aaossa Apr 03 '22 at 18:34
  • Can you guide me on building manually the wheel, that is referred in the 2nd answer of that post? I downloaded the `source` / the .tar.gz file – Anonymous Apr 03 '22 at 18:49

1 Answers1

5

Problem solved :)

So the steps I followed were:

  1. >>> pip3 uninstall Pillow
  2. >>> brew install libjpeg libtiff little-cms2 openjpeg webp
  3. >>> python3 -m pip install --upgrade pip
  4. >>> python3 -m pip install --upgrade Pillow --no-binary :all:

Reasoning and more details can be found here: https://pillow.readthedocs.io/en/latest/installation.html#building-on-macos

Note: from the second answer of the linked post Why is pip installing Pillow for OS X 10.12, when I have OS X 10.11 installed? , I borrowed the 1st command for uninstalling.

Anonymous
  • 61
  • 6