Open shanemcquillan opened 3 years ago
Hi @shanemcquillan I'm experiencing a similar issue on Mac Catalina 10.15.7 but I'm not on an M1.
I've posted my full stack trace on issue #43
I'm not sure they are the same issue, while I can install libheif it will not finish the install of pyheif
Requirement already satisfied: cffi>=1.0.0 in ./venv/lib/python3.8/site-packages (from pyheif) (1.14.5)
Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi>=1.0.0->pyheif) (2.20)
Building wheels for collected packages: pyheif
Building wheel for pyheif (setup.py) ... error
ERROR: Command errored out with exit status 1:
For anyone looking for a workaround on M1 Macs, I was able to get pyheif to install successfully with Rosetta2.
@shanemcquillan Could you please provide us with more details (python version etc)?
Hi @panosangelopoulos. Here's some versioning info:
Python 3.9.6 macOS Big Sur 11.2.3 libheif 1.12.0
Let me know if you need anything else.
I believe I may have found a way to temporarily workaround this issue on m1 machines.
1) similar to @shanemcquillan I had to setup a few things with Rosetta2. Not sure how he set that up, but for me I essentially have two different brew installations, brew
for the m1 version and brow
the x86. Guide to set that up can be found on the first half of this article
2) Once that's done I used pyenv to manage different python environments. In this particular case I used python 3.9.10.
If I were to install pyheif
as is (via pip install pyheif
) I would encounter the same issue above, namely _libheif_cffi.abi3.so, 0x0002): symbol not found in flat namespace '_heif_check_filetype'
3) The solution was based on an issue found here (thanks to @ant32bit for pointing me there) what got it to work was running the following:
# brow is a synonym to a x86 brew installation, refer to #1 to see how it was setup. otherwise use brew instead
python -m pip uninstall cffi pyheif pycparser
LDFLAGS="-L$(brow --prefix libheif)/lib" CFLAGS="-I$(brow --prefix libheif)/include" pip install pyheif --no-cache-dir
Hi, I've written a full document, step by step on how to install pyheif on M1 Mac. You can found it here. Hope it helps!
Been a year and a half, can we get this fixed?
Hi Folks. I'm running into a runtime issue with pyheif on my M1 Mac:
I'm happy to provide any help here to get to the bottom of this; I've already tried a bunch of things on my end and haven't had any luck. Some notes that may help figure out what's going on:
1) I'm using brew to install libheif. It's worth noting that brew install's packages in a different location on M1 Macs (/opt/homebrew) vs. Intel Macs (/usr/local) 2) Folks were seeing a similar issue with the cryptography package on M1 Macs, which is related to
cffi
. I've tried installing that package specifying the brew header and shared library paths without any luck. I also tried the same for thepyheif
install without any luck. 3) I was able to successfully compare two .heic images using ImageMagick, so it appears that my installation of libheif is good. 4) I've confirmed this symbol appears in the shared libraries I have installed:5) Installation also failed initially, but I was able to resolve that with the following command:
Any ideas? Let me know what I can do to help get to the bottom of this.