Cannot pip3 install pyheif on MAC OS Ventura 13.6.3

132 Views Asked by At

To put it short, libheif is there but libheif/heif.h is not (?).

I tried a)

$ pip3 install pyheif

-- getting an error:

""""""""""
 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -Wno-error=unreachable-code -I/usr/local/include -I/usr/include -I/opt/local/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -c build/temp.macosx-10.9-universal2-3.9/_libheif_cffi.c -o 

  build/temp.macosx-10.9-universal2-3.9/build/temp.macosx-10.9-universal2-3.9/_libheif_cffi.o

  build/temp.macosx-10.9-universal2-3.9/_libheif_cffi.c:570:15: fatal error: 'libheif/heif.h' file not found

           #include "libheif/heif.h"
    
                    ^~~~~~~~~~~~~~~~
    
      1 error generated.
    
      error: command '/usr/bin/clang' failed with exit code 1

""""""""""

In short,

fatal error: 'libheif/heif.h' file not found

But libheif seems to be installed fine:

>> $ brew install libffi libheif
==> Downloading https://formulae.brew.sh/api/formula.jws.json
-#O=#    #       #                                                                                                                                                                  
==> Downloading https://formulae.brew.sh/api/cask.jws.json
-#O=#    #       #                                                                                                                                                                  
Warning: libffi 3.4.4 is already installed and up-to-date.
To reinstall 3.4.4, run:
  brew reinstall libffi
Warning: libheif 1.17.6 is already installed and up-to-date.
To reinstall 1.17.6, run:
  brew reinstall libheif
>> $

1-b) Variation "sudo python3 -m pip install pyheif" gives the same error :

fatal error: 'libheif/heif.h' file not found
           #include "libheif/heif.h"
                    ^~~~~~~~~~~~~~~~
  1. From GIT:
>> $ pip install git+https://github.com/carsales/pyheif.git
-- same error: 
Fatal error: 'libheif/heif.h' file not found
           #include "libheif/heif.h"
                    ^~~~~~~~~~~~~~~~
      1 error generated.

Please help.

0

There are 0 best solutions below