Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyheif doesn't install even after brew install libffi libheif #93

Open
Alex-Son23 opened this issue Aug 17, 2023 · 13 comments
Open

pyheif doesn't install even after brew install libffi libheif #93

Alex-Son23 opened this issue Aug 17, 2023 · 13 comments

Comments

@Alex-Son23
Copy link

Alex-Son23 commented Aug 17, 2023

I tried to instal pyheif on mac m1 and i have this issue

copying pyheif/reader.py -> build/lib.macosx-13.1-arm64-cpython-311/pyheif
      copying pyheif/writer.py -> build/lib.macosx-13.1-arm64-cpython-311/pyheif
      creating build/lib.macosx-13.1-arm64-cpython-311/pyheif/data
      copying pyheif/data/version.txt -> build/lib.macosx-13.1-arm64-cpython-311/pyheif/data
      running build_ext
      generating cffi module 'build/temp.macosx-13.1-arm64-cpython-311/_libheif_cffi.c'
      creating build/temp.macosx-13.1-arm64-cpython-311
      building '_libheif_cffi' extension
      creating build/temp.macosx-13.1-arm64-cpython-311/build
      creating build/temp.macosx-13.1-arm64-cpython-311/build/temp.macosx-13.1-arm64-cpython-311
      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/include -I/usr/include -I/opt/local/include -I/Users/alexson/Documents/coding/638mm-master-mainroot/mainroot/env/include -I/Users/alexson/.pyenv/versions/3.11.3/include/python3.11 -c build/temp.macosx-13.1-arm64-cpython-311/_libheif_cffi.c -o build/temp.macosx-13.1-arm64-cpython-311/build/temp.macosx-13.1-arm64-cpython-311/_libheif_cffi.o
      build/temp.macosx-13.1-arm64-cpython-311/_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
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyheif
  Running setup.py clean for pyheif
Failed to build pyheif
ERROR: Could not build wheels for pyheif, which is required to install pyproject.toml-based projects

im already used brew install libffi libheif but in doesn't help

@Alex-Son23 Alex-Son23 changed the title 1 error generated. error: command '/usr/bin/clang' failed with exit code 1 pyheif doesn't install even after brew install libffi libheif Aug 17, 2023
@homm
Copy link
Contributor

homm commented Aug 23, 2023

You don't have homebrew properly installed in your system. Try this:

$ eval "$(/opt/homebrew/bin/brew shellenv)"

$ pip install git+https://github.com/carsales/pyheif.git@master#egg=pyheif
Collecting pyheif
Building wheels for collected packages: pyheif
  Building wheel for pyheif (setup.py) ... done
  Created wheel for pyheif: filename=pyheif-0.7.1-cp39-cp39-macosx_10_9_universal2.whl
Successfully built pyheif
Installing collected packages: pyheif
Successfully installed pyheif-0.7.1

$ ipython 
Python 3.9.6 (default, May  7 2023, 23:32:44) 

In [1]: import pyheif

In [2]: pyheif.__version__
Out[2]: '0.7.1'

@serjsv87
Copy link

I don't know how it was possible to install brew incorrectly. I also encountered the same problem, (I have a mac M2). If the problem is frequent, maybe make a note in the readmy.

@homm
Copy link
Contributor

homm commented Sep 22, 2023

If the problem is frequent, it's better to fill a ticket in brew, since it's related to any other library, not pyheif only.

@Headmaster11
Copy link

Have the same problem with mac m1 and python3.11

@homm
Copy link
Contributor

homm commented Nov 2, 2023

@Headmaster11 Please provide more info:

  1. Do you have HOMEBREW_PREFIX environment variable?
  2. Did you do eval "$(brew shellenv)"?
  3. Have you been aware that this is required step of brew installation?
  4. Have you reed instruction during brew installation?
  5. Have you filled a ticket in brew that you as a user had no idea about required installation step?

@laurogripa
Copy link

laurogripa commented Jan 4, 2024

Same problem with Mac M2

I have $HOMEBREW_PREFIX set, tried eval, and installed all dependencies

@evanscho
Copy link

Same problem but with Mac Intel (Python 3.12), also have $HOMEBREW_PREFIX set, tried eval, and installed all dependencies. Ended up using Wand/Imagemagick.

@kaxi1993
Copy link

Same problem here with mac m3 ☹️

@maikebrasil
Copy link

maikebrasil commented May 6, 2024

@Headmaster11 Please provide more info:

  1. Do you have HOMEBREW_PREFIX environment variable?
  2. Did you do eval "$(brew shellenv)"?
  3. Have you been aware that this is required step of brew installation?
  4. Have you reed instruction during brew installation?
  5. Have you filled a ticket in brew that you as a user had no idea about required installation step?

Hey, sorry, could you please explain what I need the "HOMEBREW_PREFIX" variable for? I think I have it, but I don't know what to do next. Also, when typing the command in 2 nothing happens (I don't know what to write into the brackets). Ty for your help <3

@alew3
Copy link

alew3 commented May 26, 2024

yep, not working for me either .. using conda in my mac. I've set export HOMEBREW_PREFIX="/opt/homebrew"
and
mac m1 max

I get the following error after pip install

OSError: [Errno 66] Directory not empty: '/private/var/folders/rn/97_xyqmx1wx1bp6b9705k79m0000gn/T/pip-req-build-7zgp_3iw/.eggs/cffi-1.16.0-py3.11-macosx-11.0-arm64.egg/cffi-1.16.0.dist-info' -> '/private/var/folders/rn/97_xyqmx1wx1bp6b9705k79m0000gn/T/pip-req-build-7zgp_3iw/.eggs/cffi-1.16.0-py3.11-macosx-11.0-arm64.egg/EGG-INFO'
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for pyheif
Failed to build pyheif
ERROR: Could not build wheels for pyheif, which is required to install pyproject.toml-based projects

@GingerNg
Copy link

same problem, macos M1

@odegraciajr
Copy link

Same problem MacOs 14.5 M1

@homm
Copy link
Contributor

homm commented Aug 16, 2024

Could you try to install from the following branch:

$ pip install git+https://github.com/uploadcare/pyheif.git@read-transformations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests