Problem :

fatal error: 'libheif/heif.h' file not found occur while Installing via pip on mac

I was trying to install specific module using pip, In order to integrate & use in my automation script. As I execute cmd from terminal I face off with fatal error.

Anyone face this before and know how to fix, please share your thoughts.

1 Answer 1


This issue is still open : More details are here

Found work around : for Mac M1

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

I borrow this answer from here

  • 1
    works for me with slight modification ;) nice one brow!
    – shanginn
    Commented Dec 28, 2023 at 5:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.